From 65ab7f8fd7b3dba7b78ef6ca676a731eed2e6251 Mon Sep 17 00:00:00 2001 From: jakeQT <96396730+jakeQT@users.noreply.github.com> Date: Thu, 19 May 2022 16:46:01 +0800 Subject: added friend/guild option added option to not hide friend and guild join/leave messages --- features/spamHider/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'features/spamHider') 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 +}; -- cgit