1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

Allow empty content through block list

This commit is contained in:
Madeline 2022-09-12 00:17:54 +10:00
parent 255aaccf20
commit d3fbc6a578
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ export class Member extends BaseClassWithoutId {
nick?: string;
setNick(val: string) {
if (BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
if (val && BannedWords.find(val)) throw FieldErrors({ nick: { message: "Bad nickname", code: "INVALID_NICKNAME" } });
this.nick = val;
}

View File

@ -117,7 +117,7 @@ export class Message extends BaseClass {
content?: string;
setContent(val: string) {
if (BannedWords.find(val)) throw new HTTPError("Message was blocked by automatic moderation", 200000);
if (val && BannedWords.find(val)) throw new HTTPError("Message was blocked by automatic moderation", 200000);
this.content = val;
}