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");
|
return void aws("error", "existence");
|
||||||
}
|
}
|
||||||
if (await isRoomFull(roomID)) return void aws("error", "limit");
|
if (await isRoomFull(roomID)) return void aws("error", "limit");
|
||||||
let queryx = await insert(
|
try {
|
||||||
roomMembers.roomID,
|
let queryx = await insert(
|
||||||
roomMembers.name,
|
roomMembers.roomID,
|
||||||
roomMembers.server,
|
roomMembers.name,
|
||||||
roomMembers.admin
|
roomMembers.server,
|
||||||
).add(
|
roomMembers.admin
|
||||||
roomID,
|
).add(
|
||||||
client.name,
|
roomID,
|
||||||
client.state == STATE.remote ? client.server.tag : "local",
|
client.name,
|
||||||
0
|
client.state == STATE.remote ? client.server.tag : "local",
|
||||||
).query(db);
|
0
|
||||||
if (queryx.affectedRows > 0) {
|
).query(db);
|
||||||
aws("ok", "");
|
if (queryx.affectedRows > 0) {
|
||||||
} else {
|
aws("ok", "");
|
||||||
aws("error", "server");
|
} else {
|
||||||
|
aws("error", "duplicate");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
aws("error", "duplicate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue