From 63cb72051c166ce51821589b0d66e7b5be52b674 Mon Sep 17 00:00:00 2001 From: Lake Date: Sun, 17 Feb 2019 16:24:14 -0500 Subject: [PATCH] Add config option "show-private-chat" Party chat messages can now be re-enabled by toggling the option "show-private-chat" --- config.json | 1 + index.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config.json b/config.json index d557b17..1339486 100644 --- a/config.json +++ b/config.json @@ -15,6 +15,7 @@ "disable-chatmsgs": false, "disable-join-leave-gmsgs": false, "disable-misc-gmsgs": false, + "show-private-chat": false, "disable-status-updates": false, "disable-version-check": false, "hide-prefix": false, diff --git a/index.js b/index.js index 41c7157..05a8359 100644 --- a/index.js +++ b/index.js @@ -152,7 +152,6 @@ function handleMsgFromGame(line) { msg = msg + " " + split[i]; } - // Replace the source information if(type === "Chat") { // For reasons unknown, sometimes messages are limited to exactly 64 characters. @@ -164,17 +163,21 @@ function handleMsgFromGame(line) { return; } + msg = msg.replace(/ *\([^)]*\): */, ""); + var checkString = "'Global'):"; if(split[10] !== checkString && split[11] !== checkString) { - console.log("Non-global detected, message will not send"); - return; + if(config["show-private-chat"]) { + msg = `*(Private)* ${msg}`; + } + else { + return; + } } - msg = msg.replace(/ *\([^)]*\): */, ""); } - if(config["log-messages"]) { console.log(msg); }