Show unread indicators next to categories containing unread channels

This commit is contained in:
Jerzy Kozera
2023-07-04 01:15:05 +02:00
parent 060e79ff2a
commit 3f6be457b1
3 changed files with 29 additions and 9 deletions

View File

@@ -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;