From 816f1a01ecc3155ad410d1ff34510b558e2d8cbf Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 8 Mar 2023 19:21:02 -0500 Subject: handle notification level 3 --- src/notifications/notifications.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/notifications') diff --git a/src/notifications/notifications.cpp b/src/notifications/notifications.cpp index bda9f46..db06651 100644 --- a/src/notifications/notifications.cpp +++ b/src/notifications/notifications.cpp @@ -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; } -- cgit v1.2.3