Allow empty content through block list

This commit is contained in:
Madeline 2022-09-12 00:17:54 +10:00
parent b504edae92
commit de15b3a9a4
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ export class Member extends BaseClassWithoutId {
nick?: string; nick?: string;
setNick(val: 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; this.nick = val;
} }

View File

@ -117,7 +117,7 @@ export class Message extends BaseClass {
content?: string; content?: string;
setContent(val: 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; this.content = val;
} }