Invite invited members too
This commit is contained in:
parent
b9559ecf82
commit
b833a030e7
1 changed files with 6 additions and 4 deletions
|
@ -176,12 +176,14 @@ export const CommandMap = {
|
||||||
const {replacement_room: newRoomId} = await upgradePromise;
|
const {replacement_room: newRoomId} = await upgradePromise;
|
||||||
if (newRoom.roomId !== newRoomId) return;
|
if (newRoom.roomId !== newRoomId) return;
|
||||||
|
|
||||||
const joinedMembers = room.getJoinedMembers()
|
const toInvite = [
|
||||||
.map(m => m.userId).filter(m => m !== cli.getUserId());
|
...room.getMembersWithMembership("join"),
|
||||||
|
...room.getMembersWithMembership("invite"),
|
||||||
|
].map(m => m.userId).filter(m => m !== cli.getUserId());
|
||||||
|
|
||||||
if (joinedMembers.length > 0) {
|
if (toInvite.length > 0) {
|
||||||
// Errors are handled internally to this function
|
// Errors are handled internally to this function
|
||||||
await inviteUsersToRoom(newRoomId, joinedMembers);
|
await inviteUsersToRoom(newRoomId, toInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
cli.removeListener('Room', checkForUpgradeFn);
|
cli.removeListener('Room', checkForUpgradeFn);
|
||||||
|
|
Loading…
Reference in a new issue