Merge branch 'new-chat-message' of https://github.com/pichalite/NodeBB into pichalite-new-chat-message

v1.18.x
Julian Lam 9 years ago
commit 674136423c

@ -366,6 +366,23 @@ define('forum/chats', ['components', 'string', 'sounds', 'forum/infinitescroll',
data.message.self = data.self; data.message.self = data.self;
Chats.appendChatMessage($('.expanded-chat .chat-content'), data.message); Chats.appendChatMessage($('.expanded-chat .chat-content'), data.message);
} else {
if (ajaxify.currentPage.startsWith("chats")) {
var roomEl = $('[data-roomid=' + data.roomId + ']');
if (roomEl.length > 0) {
roomEl.addClass("unread");
} else {
var recentEl = components.get('chat/recent');
templates.parse('partials/chat_recent_room', {
rooms: { "roomId": data.roomId, "lastUser": data.message.fromUser, "usernames": data.message.fromUser.username, "unread": true }
}, function(html) {
translator.translate(html, function(translated) {
recentEl.prepend(translated);
});
});
}
}
} }
}); });

Loading…
Cancel
Save