diff options
Diffstat (limited to 'src/discord/objects.hpp')
-rw-r--r-- | src/discord/objects.hpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/discord/objects.hpp b/src/discord/objects.hpp index 9db9369..1545cf4 100644 --- a/src/discord/objects.hpp +++ b/src/discord/objects.hpp @@ -272,10 +272,17 @@ struct ReadStateData { friend void from_json(const nlohmann::json &j, ReadStateData &m); }; +enum class NotificationLevel { + ALL_MESSAGES = 0, + ONLY_MENTIONS = 1, + NO_MESSAGES = 2, + USE_UPPER = 3, // actually called "NULL" +}; + struct UserGuildSettingsChannelOverride { bool Muted; MuteConfigData MuteConfig; - int MessageNotifications; + NotificationLevel MessageNotifications; bool Collapsed; Snowflake ChannelID; @@ -290,19 +297,21 @@ struct UserGuildSettingsEntry { bool Muted; MuteConfigData MuteConfig; bool MobilePush; - int MessageNotifications; + NotificationLevel MessageNotifications; bool HideMutedChannels; Snowflake GuildID; std::vector<UserGuildSettingsChannelOverride> ChannelOverrides; friend void from_json(const nlohmann::json &j, UserGuildSettingsEntry &m); friend void to_json(nlohmann::json &j, const UserGuildSettingsEntry &m); + + std::optional<UserGuildSettingsChannelOverride> GetOverride(Snowflake channel_id) const; }; struct UserGuildSettingsData { int Version; bool IsPartial; - std::vector<UserGuildSettingsEntry> Entries; + std::map<Snowflake, UserGuildSettingsEntry> Entries; friend void from_json(const nlohmann::json &j, UserGuildSettingsData &m); }; |