From e1cdca2b96ffc0526f1172b26a52b20e21877fc0 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Thu, 2 Oct 2025 05:09:45 -0400 Subject: [PATCH] Fixed bug with sesh starting --- src/app/channel/chatHandler.js | 18 ++++++++++++------ src/app/pm/pmHandler.js | 12 ++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/app/channel/chatHandler.js b/src/app/channel/chatHandler.js index c4d22c2..bc1e751 100644 --- a/src/app/channel/chatHandler.js +++ b/src/app/channel/chatHandler.js @@ -73,13 +73,19 @@ class chatHandler{ * @param {Object} data - Event payload */ async handleChat(socket, data){ - //Preprocess chat data - const preprocessedChat = await this.chatPreprocessor.preprocess(socket, data); + try{ + //Preprocess chat data + const preprocessedChat = await this.chatPreprocessor.preprocess(socket, data); - //If send flag wasn't set to false - if(preprocessedChat != false){ - //Send that shit! - this.relayUserChat(socket, preprocessedChat.message, preprocessedChat.chatType, preprocessedChat.links); + //If send flag wasn't set to false + if(preprocessedChat != false){ + //Send that shit! + this.relayUserChat(socket, preprocessedChat.message, preprocessedChat.chatType, preprocessedChat.links); + } + //If something fucked up + }catch(err){ + //Bitch and moan + return loggerUtils.socketExceptionHandler(socket, err); } } diff --git a/src/app/pm/pmHandler.js b/src/app/pm/pmHandler.js index 0e80206..1414914 100644 --- a/src/app/pm/pmHandler.js +++ b/src/app/pm/pmHandler.js @@ -92,6 +92,18 @@ class pmHandler{ 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 const preprocessedMessage = await this.chatPreprocessor.preprocess(socket, data);