diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-01-20 01:40:27 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-01-20 01:40:27 -0500 |
commit | 2328c8bafee708fc33dcd004562a270183ebcf30 (patch) | |
tree | b2226646044e03e4ee7b7c92c992f3337e42dd6b /src/discord/discord.cpp | |
parent | dfd642bb82d2998cc563f0f401f2d522632692c1 (diff) | |
download | abaddon-portaudio-2328c8bafee708fc33dcd004562a270183ebcf30.tar.gz abaddon-portaudio-2328c8bafee708fc33dcd004562a270183ebcf30.zip |
handle initial muted state for threads
Diffstat (limited to 'src/discord/discord.cpp')
-rw-r--r-- | src/discord/discord.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index ff269df..e123818 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -2389,10 +2389,14 @@ void DiscordClient::HandleReadyGuildSettings(const ReadyEventData &data) { // i dont like this implementation for muted categories but its rather simple and doesnt use a horriiible amount of ram std::unordered_map<Snowflake, std::vector<Snowflake>> category_children; - for (const auto &guild : data.Guilds) + for (const auto &guild : data.Guilds) { for (const auto &channel : *guild.Channels) if (channel.ParentID.has_value() && !channel.IsThread()) category_children[*channel.ParentID].push_back(channel.ID); + for (const auto &thread : *guild.Threads) + if (thread.ThreadMember.has_value() && thread.ThreadMember->IsMuted.has_value() && *thread.ThreadMember->IsMuted) + m_muted_channels.insert(thread.ID); + } const auto now = Snowflake::FromNow(); for (const auto &entry : data.GuildSettings.Entries) { |