diff options
author | jakeQT <96396730+jakeQT@users.noreply.github.com> | 2022-05-19 16:46:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 16:46:01 +0800 |
commit | 65ab7f8fd7b3dba7b78ef6ca676a731eed2e6251 (patch) | |
tree | e3033bd4054f537381f89226f48c5b53883a88dc /features/spamHider | |
parent | 5e64350b4f9b2125225ef4f4ed97ebc411645b19 (diff) | |
download | SoopyV2-65ab7f8fd7b3dba7b78ef6ca676a731eed2e6251.tar.gz SoopyV2-65ab7f8fd7b3dba7b78ef6ca676a731eed2e6251.tar.bz2 SoopyV2-65ab7f8fd7b3dba7b78ef6ca676a731eed2e6251.zip |
added friend/guild option
added option to not hide friend and guild join/leave messages
Diffstat (limited to 'features/spamHider')
-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 +}; |