mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 05:40:43 +01:00
fix: remove unused conditional, dont add dupe messages
This commit is contained in:
@@ -70,13 +70,10 @@ define('chat', [
|
||||
roomData.silent = true;
|
||||
roomData.uid = app.user.uid;
|
||||
roomData.isSelf = isSelf;
|
||||
module.createModal(roomData, function (modal) {
|
||||
module.createModal(roomData, function () {
|
||||
if (!isSelf) {
|
||||
updateTitleAndPlaySound(data.message.mid, username);
|
||||
}
|
||||
if (!modal) {
|
||||
addMessageToModal(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -87,7 +84,10 @@ define('chat', [
|
||||
var username = data.message.fromUser.username;
|
||||
var isSelf = data.self === 1;
|
||||
require(['forum/chats/messages'], function (ChatsMessages) {
|
||||
ChatsMessages.appendChatMessage(modal.find('.chat-content'), data.message);
|
||||
// don't add if already added
|
||||
if (!modal.find('[data-mid="' + data.message.messageId + '"]').length) {
|
||||
ChatsMessages.appendChatMessage(modal.find('.chat-content'), data.message);
|
||||
}
|
||||
|
||||
if (modal.is(':visible')) {
|
||||
taskbar.updateActive(modal.attr('data-uuid'));
|
||||
|
||||
Reference in New Issue
Block a user