mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
chat fix
This commit is contained in:
@@ -92,7 +92,7 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) {
|
||||
|
||||
if (Chats.isCurrentChat(data.withUid)) {
|
||||
newMessage = data.self === 0;
|
||||
|
||||
data.message.self = data.self;
|
||||
Chats.parseMessage(data.message, function(html) {
|
||||
var newMessage = $(html);
|
||||
newMessage.insertBefore(typingNotifEl);
|
||||
|
||||
@@ -63,6 +63,7 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
||||
|
||||
var username = data.message.fromUser.username;
|
||||
var isSelf = parseInt(data.message.fromUser.uid, 10) === parseInt(app.uid, 10);
|
||||
data.message.self = data.self;
|
||||
if (isSelf) {
|
||||
username = data.message.toUser.username;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ SocketModules.chats.send = function(socket, data, callback) {
|
||||
server.getUserSockets(touid).forEach(function(s) {
|
||||
s.emit('event:chats.receive', {
|
||||
withUid: socket.uid,
|
||||
message: recipMessage,
|
||||
message: message,
|
||||
self: 0
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user