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

v1.18.x
barisusakli 9 years ago
parent d8810ceae9
commit 1bd9b364e4

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

Loading…
Cancel
Save