Ignore empty messages in socket.io

merge-requests/1/head
knotteye 2019-11-10 09:07:23 -06:00
parent 73e91783e3
commit 4e19bdc2f5
1 changed files with 1 additions and 0 deletions

View File

@ -182,6 +182,7 @@ async function init(satyr: any, port: number, ircconf: any){
} }
}); });
socket.on('MSG', (data) => { socket.on('MSG', (data) => {
if(data.msg === "") return;
io.to(data.room).emit('MSG', {nick: socket.nick, msg: data.msg}); io.to(data.room).emit('MSG', {nick: socket.nick, msg: data.msg});
if(ircconf.enable) irc.send(socket.nick, data.room, data.msg); if(ircconf.enable) irc.send(socket.nick, data.room, data.msg);
}); });