diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-19 16:52:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 16:52:04 +0800 |
commit | c42bd292b62deaa6e7e64c8620473e193c539b88 (patch) | |
tree | de1ec652eeed87e3ac7995807734b5fbef160543 /features/spamHider/index.js | |
parent | ef4fc3a73b704c453452f40f2eea468175cbc6fb (diff) | |
parent | 65ab7f8fd7b3dba7b78ef6ca676a731eed2e6251 (diff) | |
download | SoopyV2-c42bd292b62deaa6e7e64c8620473e193c539b88.tar.gz SoopyV2-c42bd292b62deaa6e7e64c8620473e193c539b88.tar.bz2 SoopyV2-c42bd292b62deaa6e7e64c8620473e193c539b88.zip |
Merge pull request #6 from jakeQT/patch-3
added friend/guild option
Diffstat (limited to 'features/spamHider/index.js')
-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 +}; |