From 3f6be457b121b0388874f8263ec0ab0be9a0c46e Mon Sep 17 00:00:00 2001 From: Jerzy Kozera <120114+jkozera@users.noreply.github.com> Date: Tue, 4 Jul 2023 01:15:05 +0200 Subject: Show unread indicators next to categories containing unread channels --- src/discord/discord.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/discord/discord.cpp') diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index 817aca8..1f54c7e 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -1317,6 +1317,16 @@ int DiscordClient::GetUnreadStateForChannel(Snowflake id) const noexcept { return iter->second; } +int DiscordClient::GetUnreadChannelsCountForCategory(Snowflake id) const noexcept { + int result = 0; + for (Snowflake channel_id : m_store.GetChannelIDsWithParentID(id)) { + const auto iter = m_unread.find(channel_id); + if (iter == m_unread.end()) continue; + result += 1; + } + return result; +} + bool DiscordClient::GetUnreadStateForGuild(Snowflake id, int &total_mentions) const noexcept { total_mentions = 0; bool has_any_unread = false; -- cgit v1.2.3