Skip to content

Node.js based forum software built for the modern web

Merge branch 'master' of https://github.com/designcreateplay/NodeBB

Baris Usakli1c27cbd90a1e
diff --cc src/websockets.js
index b8366021d0,3a24ea4ff5..0440d9643b
--- a/src/websockets.js
+++ b/src/websockets.js
@@@ -526,16 -525,13 +526,17 @@@ var SocketIO = require('socket.io').lis
var msg = utils.strip_tags(data.message);
+ var uids = [touid,uid].sort();
+ var chatroom = 'chat_' + uids[0] + '_' + uids[1];
+ console.log('entering chat room ', chatroom);
+ 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) {
});