mirror of
https://github.com/celisej567/abaddon.git
synced 2026-01-05 18:09:48 +03:00
handle notification level 3
This commit is contained in:
@@ -276,6 +276,7 @@ enum class NotificationLevel {
|
||||
ALL_MESSAGES = 0,
|
||||
ONLY_MENTIONS = 1,
|
||||
NO_MESSAGES = 2,
|
||||
USE_UPPER = 3, // actually called "NULL"
|
||||
};
|
||||
|
||||
struct UserGuildSettingsChannelOverride {
|
||||
|
||||
@@ -44,14 +44,29 @@ bool CheckGuildMessage(const Message &message) {
|
||||
|
||||
const auto channel_settings = guild_settings->GetOverride(message.ChannelID);
|
||||
|
||||
// if there are guild settings but no channel settings then fallback to category or guild
|
||||
|
||||
// 🥴
|
||||
NotificationLevel level;
|
||||
if (channel_settings.has_value()) {
|
||||
level = channel_settings->MessageNotifications;
|
||||
if (channel_settings->MessageNotifications == NotificationLevel::USE_UPPER) {
|
||||
if (category_settings.has_value()) {
|
||||
if (category_settings->MessageNotifications == NotificationLevel::USE_UPPER) {
|
||||
level = guild_settings->MessageNotifications;
|
||||
} else {
|
||||
level = category_settings->MessageNotifications;
|
||||
}
|
||||
} else {
|
||||
level = guild_settings->MessageNotifications;
|
||||
}
|
||||
} else {
|
||||
level = channel_settings->MessageNotifications;
|
||||
}
|
||||
} else {
|
||||
if (category_settings.has_value()) {
|
||||
level = category_settings->MessageNotifications;
|
||||
if (category_settings->MessageNotifications == NotificationLevel::USE_UPPER) {
|
||||
level = guild_settings->MessageNotifications;
|
||||
} else {
|
||||
level = category_settings->MessageNotifications;
|
||||
}
|
||||
} else {
|
||||
level = guild_settings->MessageNotifications;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user