From 2328c8bafee708fc33dcd004562a270183ebcf30 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Thu, 20 Jan 2022 01:40:27 -0500 Subject: handle initial muted state for threads --- src/discord/discord.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/discord/discord.cpp') 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> 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) { -- cgit v1.2.3