Fixed bug with sesh starting
This commit is contained in:
parent
6f89f36fb8
commit
e1cdca2b96
|
|
@ -73,13 +73,19 @@ class chatHandler{
|
||||||
* @param {Object} data - Event payload
|
* @param {Object} data - Event payload
|
||||||
*/
|
*/
|
||||||
async handleChat(socket, data){
|
async handleChat(socket, data){
|
||||||
//Preprocess chat data
|
try{
|
||||||
const preprocessedChat = await this.chatPreprocessor.preprocess(socket, data);
|
//Preprocess chat data
|
||||||
|
const preprocessedChat = await this.chatPreprocessor.preprocess(socket, data);
|
||||||
|
|
||||||
//If send flag wasn't set to false
|
//If send flag wasn't set to false
|
||||||
if(preprocessedChat != false){
|
if(preprocessedChat != false){
|
||||||
//Send that shit!
|
//Send that shit!
|
||||||
this.relayUserChat(socket, preprocessedChat.message, preprocessedChat.chatType, preprocessedChat.links);
|
this.relayUserChat(socket, preprocessedChat.message, preprocessedChat.chatType, preprocessedChat.links);
|
||||||
|
}
|
||||||
|
//If something fucked up
|
||||||
|
}catch(err){
|
||||||
|
//Bitch and moan
|
||||||
|
return loggerUtils.socketExceptionHandler(socket, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,18 @@ class pmHandler{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If this is a sesh starter
|
||||||
|
if(data.msg == '' || data.msg == null){
|
||||||
|
//Skip pre-processing and send a cooked message
|
||||||
|
return this.relayPMObj(new message(
|
||||||
|
socket.user.user,
|
||||||
|
recipients,
|
||||||
|
'',
|
||||||
|
'chat',
|
||||||
|
[]
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
//preprocess message
|
//preprocess message
|
||||||
const preprocessedMessage = await this.chatPreprocessor.preprocess(socket, data);
|
const preprocessedMessage = await this.chatPreprocessor.preprocess(socket, data);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue