joinpublicromm error msg fix

This commit is contained in:
jusax23 2023-03-29 19:19:58 +02:00
parent c22ca39e3b
commit 27bdd2e15b
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41

View file

@ -316,6 +316,7 @@ export const joinPublicRoom: Act = {
return void aws("error", "existence"); return void aws("error", "existence");
} }
if (await isRoomFull(roomID)) return void aws("error", "limit"); if (await isRoomFull(roomID)) return void aws("error", "limit");
try {
let queryx = await insert( let queryx = await insert(
roomMembers.roomID, roomMembers.roomID,
roomMembers.name, roomMembers.name,
@ -330,7 +331,10 @@ export const joinPublicRoom: Act = {
if (queryx.affectedRows > 0) { if (queryx.affectedRows > 0) {
aws("ok", ""); aws("ok", "");
} else { } else {
aws("error", "server"); aws("error", "duplicate");
}
} catch (error) {
aws("error", "duplicate");
} }
} }
}; };