This commit is contained in:
Mirco Wittrien 2020-06-05 10:50:23 +02:00
parent 1405088e32
commit 106e1c99d0
3 changed files with 13 additions and 6 deletions

View File

@ -68,7 +68,7 @@ var NotificationSounds = (_ => {
return class NotificationSounds {
getName () {return "NotificationSounds";}
getVersion () {return "3.4.4";}
getVersion () {return "3.4.5";}
getAuthor () {return "DevilBro";}
@ -76,7 +76,7 @@ var NotificationSounds = (_ => {
constructor () {
this.changelog = {
"fixed":[["Call Sound","Outgoing and Incomming call sounds work again"]]
"fixed":[["Mention Sound","No longer plays when the server/channel has message notifications completely disabled"]]
};
this.patchedModules = {
@ -347,7 +347,7 @@ var NotificationSounds = (_ => {
return;
}
else if (BDFDB.LibraryModules.MentionUtils.isRawMessageMentioned(message, BDFDB.UserUtils.me.id)) {
if (message.mentions.length && !(choices.mentioned.focus && document.hasFocus() && BDFDB.LibraryModules.LastChannelStore.getChannelId() == message.channel_id)) for (let mention of message.mentions) if (mention.id == BDFDB.UserUtils.me.id) {
if (message.mentions.length && !this.isSuppressMentionEnabled(guildId, message.channel_id) && !(choices.mentioned.focus && document.hasFocus() && BDFDB.LibraryModules.LastChannelStore.getChannelId() == message.channel_id)) for (let mention of message.mentions) if (mention.id == BDFDB.UserUtils.me.id) {
this.fireEvent("mentioned");
this.playAudio("mentioned");
return;
@ -528,6 +528,11 @@ var NotificationSounds = (_ => {
audio.play();
}
isSuppressMentionEnabled (guildId, channelId) {
let channelSettings = BDFDB.LibraryModules.MutedUtils.getChannelMessageNotifications(guildId, channelId);
return channelSettings && (channelSettings == BDFDB.DiscordConstants.UserNotificationSettings.NO_MESSAGES || channelSettings == BDFDB.DiscordConstants.UserNotificationSettings.NULL && BDFDB.LibraryModules.MutedUtils.getMessageNotifications(guildId) == BDFDB.DiscordConstants.UserNotificationSettings.NO_MESSAGES);
}
dontPlayAudio (type) {
let status = BDFDB.UserUtils.getStatus();
return choices[type].mute && (status == "dnd" || status == "streaming");

View File

@ -8,7 +8,7 @@
--messagetransparency: 0.5; /* default: 0.5 (additional shadows behind messages, set to 0 to remove boxes) */
--guildchanneltransparency: 0.15; /* default: 0.15 (additional darkness for guild/channel list) */
--memberlisttransparency: 0.0; /* default: 0.0 (additional darkness for member list) */
--accentcolor: 190,78,180; /* default: 190,78,180 (blurple: 114,137,218 bd-blue: 58,113,193) */
--accentcolor: 190,78,180; /* default: 190,78,180 (RGB-format - blurple: 114,137,218 bd-blue: 58,113,193) */
--font: Whitney, Helvetica Neue, Helvetica, Arial, sans-serif; /* font used in most places */
--textshadow: transparent; /* default: transparent (textshadow for text ontop of accentcolor nodes, ONLY accepts a color, no px) */

View File

@ -2,7 +2,9 @@
@import url(https://mwittrien.github.io/BetterDiscordAddons/Themes/BlurpleRecolor/BlurpleRecolor.css);
/* all colors are in RGB format (red, green, blue) use: https://www.google.com/search?q=colorpicker */
:root {
--accentcolor: 163,47,194; /* blurple - default: 114,137,218 */
--linkcolor: 190,60,220; /* link - default: 0,176,244 */
--accentcolor: 163,47,194; /* blurple - default: 114,137,218 */
--linkcolor: 190,60,220; /* link - default: 0,176,244 */
}