cache fixes

on newRoom and deleteRooms clear cache
add some checks for empty groups list
This commit is contained in:
Barış Soner Uşaklı
2023-07-12 16:35:46 -04:00
parent 18a1663b5e
commit 547bde8939
4 changed files with 42 additions and 18 deletions

View File

@@ -52,6 +52,9 @@ chatsAPI.create = async function (caller, data) {
if (!isPublic && !data.uids.length) {
throw new Error('[[error:no-users-selected]]');
}
if (isPublic && (!Array.isArray(data.groups) || !data.groups.length)) {
throw new Error('[[error:no-groups-selected]]');
}
await Promise.all(data.uids.map(async uid => messaging.canMessageUser(caller.uid, uid)));
const roomId = await messaging.newRoom(caller.uid, data);