Skip to content

Node.js based forum software built for the modern web

fix notifs, dont send to self, fix notification path to roomId

barisusakli1bd9b364e493
diff --git a/src/messaging/notifications.js b/src/messaging/notifications.js
index c9aa10eb33..9fca3c952b 100644
--- a/src/messaging/notifications.js
+++ b/src/messaging/notifications.js
@@ -59,7 +59,7 @@ module.exports = function(Messaging) {
}
uids = uids.filter(function(uid, index) {
- return isOnline[index];
+ return isOnline[index] && parseInt(fromuid, 10) !== parseInt(uid, 10);
});
if (!uids.length) {
@@ -71,7 +71,7 @@ module.exports = function(Messaging) {
bodyLong: messageObj.content,
nid: 'chat_' + fromuid + '_' + roomId,
from: fromuid,
- path: '/chats/' + messageObj.fromUser.username
+ path: '/chats/' + messageObj.roomId
}, function(err, notification) {
if (!err && notification) {
notifications.push(notification, uids, callback);