summaryrefslogtreecommitdiff
path: root/src/discord/objects.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-04-11 04:36:27 +0000
committerGitHub <noreply@github.com>2023-04-11 04:36:27 +0000
commit44ab35dfd591c4c357673cc2ce3cb3a6964a1fff (patch)
tree91a60f1dfdd9d5a7e1c88b0eef0990981a307ada /src/discord/objects.hpp
parent0b663246809519487c155c51ccebb8df0e14a227 (diff)
parentf5228d91d28e39d56c7245ecf0128895273c9ec0 (diff)
downloadabaddon-portaudio-44ab35dfd591c4c357673cc2ce3cb3a6964a1fff.tar.gz
abaddon-portaudio-44ab35dfd591c4c357673cc2ce3cb3a6964a1fff.zip
Merge pull request #145 from uowuo/notifications
Notifications
Diffstat (limited to 'src/discord/objects.hpp')
-rw-r--r--src/discord/objects.hpp15
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);
};