mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: #8127 user join system message duplicated
- Now showing user-join message for chat owner in addition to the newly added user - If a modal already exists for a room when createModal is called, don't return null, return the modal
This commit is contained in:
@@ -145,7 +145,7 @@ define('chat', [
|
|||||||
require(['scrollStop', 'forum/chats', 'forum/chats/messages'], function (scrollStop, Chats, ChatsMessages) {
|
require(['scrollStop', 'forum/chats', 'forum/chats/messages'], function (scrollStop, Chats, ChatsMessages) {
|
||||||
app.parseAndTranslate('chat', data, function (chatModal) {
|
app.parseAndTranslate('chat', data, function (chatModal) {
|
||||||
if (module.modalExists(data.roomId)) {
|
if (module.modalExists(data.roomId)) {
|
||||||
return callback(null);
|
return callback(module.getModal(data.roomId));
|
||||||
}
|
}
|
||||||
var uuid = utils.generateUUID();
|
var uuid = utils.generateUUID();
|
||||||
var dragged = false;
|
var dragged = false;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ module.exports = function (Messaging) {
|
|||||||
db.sortedSetAdd('chat:room:' + roomId + ':uids', now, uid),
|
db.sortedSetAdd('chat:room:' + roomId + ':uids', now, uid),
|
||||||
]);
|
]);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
Messaging.addSystemMessage('user-join', uid, roomId), // chat owner should also get the user-join system message
|
||||||
Messaging.addUsersToRoom(uid, toUids, roomId),
|
Messaging.addUsersToRoom(uid, toUids, roomId),
|
||||||
Messaging.addRoomToUsers(roomId, [uid].concat(toUids), now),
|
Messaging.addRoomToUsers(roomId, [uid].concat(toUids), now),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user