diff --git a/www/js/channel/panels/pmPanel.js b/www/js/channel/panels/pmPanel.js index 85e191e..261c694 100644 --- a/www/js/channel/panels/pmPanel.js +++ b/www/js/channel/panels/pmPanel.js @@ -108,14 +108,20 @@ class pmPanel extends panelObj{ //Pull current sesh from sesh list const sesh = this.client.pmHandler.seshList.get(this.activeSesh); - //Send message out to server - this.client.pmSocket.emit("pm", { - recipients: sesh.recipients, - msg: this.seshPrompt.value - }); + //Preprocess message from prompt + const preprocessedMessage = this.client.chatBox.commandPreprocessor.preprocess(this.seshPrompt.value); - //Clear our prompt - this.seshPrompt.value = ""; + //If preprocessedMessage had it's send flag thrown as false + if(preprocessedMessage != false){ + //Stick recipients into the pre-processed message + preprocessedMessage.recipients = sesh.recipients; + + //Send message out to server + this.client.pmSocket.emit("pm", preprocessedMessage); + } + + //Clear our prompt + this.seshPrompt.value = ""; } }