mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
dont make a copy of chat message
This commit is contained in:
@@ -202,16 +202,13 @@ SocketModules.chats.send = function(socket, data, callback) {
|
||||
|
||||
sendChatNotification(socket.uid, touid, message);
|
||||
|
||||
// After-the-fact fixing of the "self" property for the message that goes to the receipient
|
||||
var recipMessage = JSON.parse(JSON.stringify(message));
|
||||
recipMessage.self = 0;
|
||||
|
||||
// Recipient
|
||||
SocketModules.chats.pushUnreadCount(touid);
|
||||
server.getUserSockets(touid).forEach(function(s) {
|
||||
s.emit('event:chats.receive', {
|
||||
withUid: socket.uid,
|
||||
message: recipMessage
|
||||
message: recipMessage,
|
||||
self: 0
|
||||
});
|
||||
});
|
||||
|
||||
@@ -220,7 +217,8 @@ SocketModules.chats.send = function(socket, data, callback) {
|
||||
server.getUserSockets(socket.uid).forEach(function(s) {
|
||||
s.emit('event:chats.receive', {
|
||||
withUid: touid,
|
||||
message: message
|
||||
message: message,
|
||||
self: 1
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user