Código alterado para ter consistência
This commit is contained in:
parent
bcf698074b
commit
95dca507dc
4
index.js
4
index.js
|
@ -327,13 +327,13 @@ wss.on('connection', ws => {
|
||||||
// Verificar termo via expressão regular.
|
// Verificar termo via expressão regular.
|
||||||
let palavraRegexIlegal = new RegExp(vars["palavra.regex.caracteresIlegais"], 'g');
|
let palavraRegexIlegal = new RegExp(vars["palavra.regex.caracteresIlegais"], 'g');
|
||||||
if (palavraRegexIlegal.test(resposta.extra.termo)){
|
if (palavraRegexIlegal.test(resposta.extra.termo)){
|
||||||
ws.send(JSON.stringify(new Resposta("PEDIDO_CANCELADO", "SERVIDOR", "PALAVRA_OU_LETRA_PROIBIDO", { erroDescrição: "TERMO_CARACTERES_ILEGAIS" })));
|
ws.send(JSON.stringify(new Resposta("PEDIDO_CANCELADO", "SERVIDOR", "TERMO_INVÁLIDO", { erroDescrição: "TERMO_CARACTERES_ILEGAIS" })));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verificar se o termo enviado possui termos filtrados CASO a sala tinha o filtro habilitado
|
// Verificar se o termo enviado possui termos filtrados CASO a sala tinha o filtro habilitado
|
||||||
if (salaObj.opções["filtro.temasAdultos.habilitado"] && Util.filtrarMensagem(resposta.extra.termo, filtros) !== resposta.extra.termo){
|
if (salaObj.opções["filtro.temasAdultos.habilitado"] && Util.filtrarMensagem(resposta.extra.termo, filtros) !== resposta.extra.termo){
|
||||||
ws.send(JSON.stringify(new Resposta("PEDIDO_CANCELADO", "SERVIDOR", "PALAVRA_OU_LETRA_PROIBIDO", { erroDescrição: "TERMO_IMPRÓPRIO" })));
|
ws.send(JSON.stringify(new Resposta("PEDIDO_CANCELADO", "SERVIDOR", "TERMO_INVÁLIDO", { erroDescrição: "TERMO_IMPRÓPRIO" })));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue