|
|
|
@ -532,10 +532,11 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
|
|
|
|
|
socket.join('chat_' + uids[0] + '_' + uids[1]);
|
|
|
|
|
|
|
|
|
|
user.getUserField(uid, 'username', function(err, username) {
|
|
|
|
|
var finalMessage = 'New message from <strong>' + username + '</strong>';
|
|
|
|
|
var finalMessage = username + ': ' + msg,
|
|
|
|
|
notifText = 'New message from <strong>' + username + '</strong>';
|
|
|
|
|
|
|
|
|
|
if(!isUserOnline(touid)) {
|
|
|
|
|
notifications.create(finalMessage, 5, '#', 'notification_' + uid + '_' + touid, function(nid) {
|
|
|
|
|
notifications.create(notifText, 5, '#', 'notification_' + uid + '_' + touid, function(nid) {
|
|
|
|
|
notifications.push(nid, [touid], function(success) {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|