no http links after filtering

This commit is contained in:
HF 2020-04-28 08:56:09 +02:00
parent 9f7495a336
commit 70d8eb1385

View File

@ -48,10 +48,6 @@ class ChatProvider {
}
async sendMessage(user, message) {
if (message.length > 200) {
// eslint-disable-next-line max-len
return 'You can\'t send a message this long :(';
}
const name = (user.regUser) ? user.regUser.name : null;
const country = (name.endsWith('berg') || name.endsWith('stein'))
? 'il'
@ -83,6 +79,15 @@ class ChatProvider {
message = message.replace(subsitute.regexp, subsitute.replace);
}
if (message.includes('http')) {
return 'no shitty links pls';
}
if (message.length > 200) {
// eslint-disable-next-line max-len
return 'You can\'t send a message this long :(';
}
if (user.isAdmin() && message.charAt(0) === '/') {
// admin commands
const cmdArr = message.split(' ');