joinpublicromm error msg fix
This commit is contained in:
parent
c22ca39e3b
commit
27bdd2e15b
1 changed files with 19 additions and 15 deletions
|
@ -316,21 +316,25 @@ export const joinPublicRoom: Act = {
|
|||
return void aws("error", "existence");
|
||||
}
|
||||
if (await isRoomFull(roomID)) return void aws("error", "limit");
|
||||
let queryx = await insert(
|
||||
roomMembers.roomID,
|
||||
roomMembers.name,
|
||||
roomMembers.server,
|
||||
roomMembers.admin
|
||||
).add(
|
||||
roomID,
|
||||
client.name,
|
||||
client.state == STATE.remote ? client.server.tag : "local",
|
||||
0
|
||||
).query(db);
|
||||
if (queryx.affectedRows > 0) {
|
||||
aws("ok", "");
|
||||
} else {
|
||||
aws("error", "server");
|
||||
try {
|
||||
let queryx = await insert(
|
||||
roomMembers.roomID,
|
||||
roomMembers.name,
|
||||
roomMembers.server,
|
||||
roomMembers.admin
|
||||
).add(
|
||||
roomID,
|
||||
client.name,
|
||||
client.state == STATE.remote ? client.server.tag : "local",
|
||||
0
|
||||
).query(db);
|
||||
if (queryx.affectedRows > 0) {
|
||||
aws("ok", "");
|
||||
} else {
|
||||
aws("error", "duplicate");
|
||||
}
|
||||
} catch (error) {
|
||||
aws("error", "duplicate");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue