summaryrefslogtreecommitdiff
path: root/src/discord/discord.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-07-05 05:01:08 +0000
committerGitHub <noreply@github.com>2023-07-05 05:01:08 +0000
commit8a5f23fcb93a8674e394943af148c511165ac153 (patch)
tree3c5c0c931dd6ab2f6ca85ce4c6ade22d08fc823e /src/discord/discord.cpp
parent060e79ff2af65c46b5a53606784345b570118f2b (diff)
parent88da9e17b86ae0315ff4c08bb22e7c78f6a19000 (diff)
downloadabaddon-portaudio-8a5f23fcb93a8674e394943af148c511165ac153.tar.gz
abaddon-portaudio-8a5f23fcb93a8674e394943af148c511165ac153.zip
Merge pull request #186 from jkozera/unread-category-indicators
Show unread indicators next to categories containing unread channels
Diffstat (limited to 'src/discord/discord.cpp')
-rw-r--r--src/discord/discord.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp
index 817aca8..7b05b2d 100644
--- a/src/discord/discord.cpp
+++ b/src/discord/discord.cpp
@@ -1317,6 +1317,17 @@ 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)) {
+ if (IsChannelMuted(channel_id)) continue;
+ 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;