fix: #11541, fix leave chat error

This commit is contained in:
Barış Soner Uşaklı
2023-05-01 09:20:52 -04:00
parent d0a15e9ec8
commit 8e0f9ce573

View File

@@ -175,9 +175,9 @@ chatsAPI.kick = async (caller, data) => {
// Additional checks if kicking vs leaving
if (data.uids.length === 1 && parseInt(data.uids[0], 10) === caller.uid) {
await messaging.leaveRoom([caller.uid], data.roomId);
} else {
await messaging.removeUsersFromRoom(caller.uid, data.uids, data.roomId);
return [];
}
await messaging.removeUsersFromRoom(caller.uid, data.uids, data.roomId);
delete data.uids;
return chatsAPI.users(caller, data);