allow multiple blank lines in eslint, check for muted user earlier

This commit is contained in:
HF 2020-11-03 23:52:20 +01:00
parent 1872b603b9
commit 493b0106ac
2 changed files with 13 additions and 11 deletions

View File

@ -31,6 +31,7 @@
"react/jsx-closing-tag-location":"off",
"jsx-a11y/click-events-have-key-events":"off",
"no-continue": "off",
"no-multiple-empty-lines": "off",
"lines-between-class-members":["warn", "always",{"exceptAfterSingleLine": true}]
}
}

View File

@ -82,6 +82,18 @@ export class ChatProvider {
return 'Stop shouting';
}
const muted = await ChatProvider.checkIfMuted(user);
if (muted === -1) {
return 'You are permanently muted, join our guilded to apppeal the mute';
}
if (muted > 0) {
if (muted > 120) {
const timeMin = Math.round(muted / 60);
return `You are muted for another ${timeMin} minutes`;
}
return `You are muted for another ${muted} seconds`;
}
for (let i = 0; i < this.filters.length; i += 1) {
const filter = this.filters[i];
const count = (message.match(filter.regexp) || []).length;
@ -154,17 +166,6 @@ export class ChatProvider {
return 'Your country is temporary muted from chat';
}
const muted = await ChatProvider.checkIfMuted(user);
if (muted === -1) {
return 'You are permanently muted, join our discord to apppeal the mute';
}
if (muted > 0) {
if (muted > 120) {
const timeMin = Math.round(muted / 60);
return `You are muted for another ${timeMin} minutes`;
}
return `You are muted for another ${muted} seconds`;
}
this.addMessage(name, message, displayCountry, channelId);
webSockets.broadcastChatMessage(name, message, displayCountry, channelId);
return null;