diff options
-rw-r--r-- | features/spamHider/index.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/features/spamHider/index.js b/features/spamHider/index.js index dee4046..141d49f 100644 --- a/features/spamHider/index.js +++ b/features/spamHider/index.js @@ -30,6 +30,8 @@ class SpamHider extends Feature { this.moveMessagesSetting = new ToggleSetting("Move some messages to spam hider", "This will move some (potentially) usefull messages into a 'second chat'", true, "move_spam", this) this.moveChatMessages = new ToggleSetting("Move spammed chat messages to spam hider", "This will move messages spammed in hubs to spam hider\n(eg the website advertisment bots)", true, "move_spam_chat", this) this.textShadowSetting = new ToggleSetting("Spam Hider Text Shadow", "Whether to give the spam hider text shadow", true, "spam_text_shadow", this) + this.showFriendMessages = new ToggleSetting("Show friend message", "should it show friend join/leave message", false, "spam_text_friend", this) + this.showGuildMessages = new ToggleSetting("Show guild message", "should it show guild mate join/leave message", false, "spam_text_guild", this) this.SpamHiderMessagesRenderer = new SpamHiderMessagesRenderer() this.textShadowSetting.toggleObject.addEvent(new SoopyContentChangeEvent().setHandler((newVal, oldVal, resetFun) => { @@ -69,6 +71,12 @@ class SpamHider extends Feature { let msg = ChatLib.getChatMessage(e, true).replace(/ยง/g, "&").replace(/(?:^&r)|(?:&r$)/g, "") if (msg.length > 1000) return //performance + //&r&aFriend > &r&6Soopyboo32 &r&ejoined.&r + if (this.showFriendMessages && msg.includes("&aFriend")) return + + //&r&2Guild > &r&6Soopyboo32 &r&ejoined.&r + if (this.showGuildMessages && msg.includes("&2Guild")) return + if (this.hideMessagesSetting.getValue()) { // console.log("testing " + (this.hideMessagesDict[msg.substring(0,5)]?.length || 0) + this.hideMessagesDict.all.length + " hide messages") this.hideMessagesDict[msg.substring(0, 5)]?.forEach(regex => { @@ -325,4 +333,4 @@ var sha256 = function a(b) { i += (16 > y ? 0 : "") + y.toString(16); } return i; -};
\ No newline at end of file +}; |