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:
Julian Lam
2020-01-21 13:57:06 -05:00
parent 106c141ff5
commit 594cd7e176
2 changed files with 2 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ module.exports = function (Messaging) {
db.sortedSetAdd('chat:room:' + roomId + ':uids', now, uid),
]);
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.addRoomToUsers(roomId, [uid].concat(toUids), now),
]);