notifications in chat messages

v1.18.x
Baris Usakli 12 years ago
parent cf64952918
commit b0be1fab16

@ -265,6 +265,13 @@ var SocketIO = require('socket.io').listen(global.server,{log:false}),
user.getUserField(uid, 'username', function(username) {
var finalMessage = username + ' says : ' + msg;
userSockets[touid].emit('chatMessage', {fromuid:uid, username:username, message:finalMessage});
notifications.create(finalMessage, 5, null, 'notification_'+new Date().getTime(), function(nid) {
notifications.push(nid, [touid], function(success) {
console.log(success);
});
});
});
}
});

Loading…
Cancel
Save