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

This commit is contained in:
barisusakli
2015-12-16 15:12:06 +02:00
parent d8810ceae9
commit 1bd9b364e4

View File

@@ -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);