From 24cea23246a0b8499fc422fdca90c480f682cdec Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 12 Feb 2022 23:41:02 +0100 Subject: [PATCH] Update NotificationSounds.plugin.js --- Plugins/NotificationSounds/NotificationSounds.plugin.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index 1ac848fd49..29a753e2f3 100644 --- a/Plugins/NotificationSounds/NotificationSounds.plugin.js +++ b/Plugins/NotificationSounds/NotificationSounds.plugin.js @@ -279,12 +279,13 @@ module.exports = (_ => { }}); BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DesktopNotificationUtils, "showNotification", {before: e => { - if (e.methodArguments[3] && e.methodArguments[3].sound && e.methodArguments[3].sound.includes("message")) e.methodArguments[3].sound = null; + if (e.methodArguments[3] && e.methodArguments[3].sound && e.methodArguments[3].sound.includes("message")) e.methodArguments[3].sound = `_BDFDB_${e.methodArguments[3].sound.split("").reverse().join("")}`; }}); BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "playSound", {instead: e => { let type = e.methodArguments[0]; if (!type) return; - else if (choices[type]) { + if (type.indexOf("_BDFDB_") == 0) type = type.replace("_BDFDB_", "").split("").reverse().join(""); + if (choices[type]) { e.stopOriginalMethodCall(); BDFDB.TimeUtils.timeout(_ => { if (type == "message1") {