diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-04-13 16:29:56 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-04-13 16:29:56 -0400 |
commit | c084230767053e942b29941a8728f421e256cf1d (patch) | |
tree | ae58dc5d3978930ec5ed1fb0e65d108b56369d42 /src/discord/objects.hpp | |
parent | 7b5dc8a86532cf00ab49a1922dbd4ce21cdaf01f (diff) | |
parent | 44ab35dfd591c4c357673cc2ce3cb3a6964a1fff (diff) | |
download | abaddon-portaudio-c084230767053e942b29941a8728f421e256cf1d.tar.gz abaddon-portaudio-c084230767053e942b29941a8728f421e256cf1d.zip |
Merge branch 'master' of https://github.com/uowuo/abaddon into voice
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 120ffa2..3ad4037 100644 --- a/src/discord/objects.hpp +++ b/src/discord/objects.hpp @@ -274,10 +274,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; @@ -292,19 +299,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); }; |