feat: show online users at the top of userlist and update

when they enter/leave
This commit is contained in:
Barış Soner Uşaklı
2023-07-14 11:19:57 -04:00
parent 887333478a
commit 911ef0581c
8 changed files with 132 additions and 26 deletions

View File

@@ -171,7 +171,9 @@ chatsAPI.users = async (caller, data) => {
const [isOwner, isUserInRoom, users] = await Promise.all([
messaging.isRoomOwner(caller.uid, data.roomId),
messaging.isUserInRoom(caller.uid, data.roomId),
messaging.getUsersInRoom(data.roomId, start, stop),
messaging.getUsersInRoomFromSet(
`chat:room:${data.roomId}:uids:online`, data.roomId, start, stop, true
),
]);
if (!isUserInRoom) {
throw new Error('[[error:no-privileges]]');