From 73c21041f6df7ceb9499857f0f05149bf6a3ad4c Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 17 Feb 2024 10:21:38 +0100 Subject: [PATCH] stuff --- Library/_res/0BDFDB.data.json | 2 +- .../NotificationSounds.plugin.js | 22 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 4476361c3c..eb5a9dc983 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -503,7 +503,7 @@ "UserTheme": {"strings": [".profileColors", "useDefaultClientTheme:"], "noSearch": true}, "VideoBackground": {"strings": ["backgroundSrc:", "pulseSpeakingIndicator:", ".avatarWrapper"]}, "VoiceUser": {"protos": ["renderPrioritySpeaker", "renderIcons", "renderAvatar"]}, - "VoiceUsers": {"strings": ["hidePreview", "previewIsOpen", "previewUserIdAfterDelay"]} + "VoiceUsers": {"strings": ["hidePreview", "previewIsOpen", "Permissions.MOVE_MEMBERS"]} }, "ModuleUtilsConfig": { "QueuedComponents": [], diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index 7e28e8232d..7d7af459d6 100644 --- a/Plugins/NotificationSounds/NotificationSounds.plugin.js +++ b/Plugins/NotificationSounds/NotificationSounds.plugin.js @@ -2,7 +2,7 @@ * @name NotificationSounds * @author DevilBro * @authorId 278543574059057154 - * @version 3.9.2 + * @version 3.9.3 * @description Allows you to replace the native Sounds with custom Sounds * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -212,11 +212,11 @@ module.exports = (_ => { streamMute: false, invisibleMute: false }; - if (id == "message1") { + if (id == "message1" || id == "message3") { types[id].mute = true; types[id].streamMute = false; types[id].invisibleMute = false; - for (let subType in message1Types) types[subType] = { + if (id == "message1") for (let subType in message1Types) types[subType] = { name: message1Types[subType].name, src: BDFDB.LibraryModules.SoundParser(message1Types[subType].src), mute: true, @@ -255,14 +255,22 @@ module.exports = (_ => { const message = e.methodArguments[0].message; const guildId = message.guild_id || null; if (message.author.id != BDFDB.UserUtils.me.id && !BDFDB.LibraryStores.RelationshipStore.isBlocked(message.author.id)) { - const isCurrent = BDFDB.LibraryStores.SelectedChannelStore.getChannelId() == message.channel_id; const channel = BDFDB.LibraryStores.ChannelStore.getChannel(message.channel_id); + + const isCurrent = BDFDB.LibraryStores.SelectedChannelStore.getChannelId() == channel.id; const isGroupDM = channel.isGroupDM(); const isThread = BDFDB.ChannelUtils.isThread(channel); + if (isThread && BDFDB.LibraryStores.JoinedThreadsStore.isMuted(channel.id) || !isThread && BDFDB.LibraryStores.UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(guildId, channel.id)) return; - if (!guildId) { + + if (isCurrent && BDFDB.LibraryStores.NotificationSettingsStore.getNotifyMessagesInSelectedChannel()) { + this.fireEvent("message3"); + this.playAudio("message3"); + return; + } + else if (!guildId) { this.fireEvent(isGroupDM ? "groupdm" : "dm"); - !BDFDB.LibraryStores.NotificationSettingsStore.getNotifyMessagesInSelectedChannel() && !document.hasFocus() && this.playAudio(isGroupDM ? "groupdm" : "dm"); + this.playAudio(isGroupDM ? "groupdm" : "dm"); return; } else if (guildId) { @@ -322,7 +330,7 @@ module.exports = (_ => { let type = e2.instance && e2.instance.name; if (type && choices[type]) { e2.stopOriginalMethodCall(); - if (type == "message1") BDFDB.TimeUtils.timeout(_ => { + if (type == "message1" || type == "message3") BDFDB.TimeUtils.timeout(_ => { let called = false; for (let subType of [type].concat(Object.keys(message1Types))) if (firedEvents[subType]) { delete firedEvents[subType];