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