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:
parent
255aaccf20
commit
d3fbc6a578
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user