From 6c733e3f3a446ee9172d3d7cd788380621062b5c Mon Sep 17 00:00:00 2001 From: Mirco Wittrien <23700969+mwittrien@users.noreply.github.com> Date: Tue, 28 Jun 2022 18:41:58 +0200 Subject: [PATCH] Update RemoveBlockedUsers.plugin.js --- .../RemoveBlockedUsers/RemoveBlockedUsers.plugin.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js b/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js index 77d69c91fc..d4eec8cf7a 100644 --- a/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js +++ b/Plugins/RemoveBlockedUsers/RemoveBlockedUsers.plugin.js @@ -2,7 +2,7 @@ * @name RemoveBlockedUsers * @author DevilBro * @authorId 278543574059057154 - * @version 1.4.9 + * @version 1.5.0 * @description Removes blocked Messages/Users * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,12 +17,12 @@ module.exports = (_ => { "info": { "name": "RemoveBlockedUsers", "author": "DevilBro", - "version": "1.4.9", + "version": "1.5.0", "description": "Removes blocked Messages/Users" }, "changeLog": { "fixed": { - "Stage/Voice": "No longer shows blocked Users in the VC Count and Stage Channel Members" + "Voice Notifications": "Fixed an Issue where nonblocked Users or yourself would stop making noices on join/leave after some occurences" } } }; @@ -176,7 +176,7 @@ module.exports = (_ => { let connectedUsers = BDFDB.ObjectUtils.filter(BDFDB.LibraryModules.VoiceUtils.getVoiceStates(BDFDB.LibraryModules.CurrentVoiceUtils.getGuildId()), n => n && n.channelId == channelId && !BDFDB.LibraryModules.RelationshipStore.isBlocked(n.userId)); BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "playSound", {instead: e => { let type = e.methodArguments[0]; - if (this.settings.notifcations.voiceChat && type == "user_join" || type == "user_leave" || type == "user_moved") { + if (this.settings.notifcations.voiceChat && (type == "disconnect" || type == "user_join" || type == "user_leave" || type == "user_moved")) { channelId = BDFDB.LibraryModules.CurrentVoiceUtils.getChannelId(); if (channelId) { let allConnectedUsers = BDFDB.ObjectUtils.filter(BDFDB.LibraryModules.VoiceUtils.getVoiceStates(BDFDB.LibraryModules.CurrentVoiceUtils.getGuildId()), n => n && n.channelId == channelId); @@ -195,7 +195,10 @@ module.exports = (_ => { else e.callOriginalMethodAfterwards(); connectedUsers = unblockedUsers; } - else e.callOriginalMethodAfterwards(); + else { + connectedUsers = {}; + e.callOriginalMethodAfterwards(); + } } else e.callOriginalMethodAfterwards(); }});