show count of unread dms in header

This commit is contained in:
ouwou
2022-01-08 20:03:12 -05:00
parent 4e0b22375f
commit 604f2ffe3d
4 changed files with 17 additions and 0 deletions

View File

@@ -1202,6 +1202,14 @@ bool DiscordClient::GetUnreadStateForGuild(Snowflake id, int &total_mentions) co
return has_any_unread;
}
int DiscordClient::GetUnreadDMsCount() const {
const auto channels = GetPrivateChannels();
int count = 0;
for (const auto channel_id : channels)
if (GetUnreadStateForChannel(channel_id) > -1) count++;
return count;
}
PresenceStatus DiscordClient::GetUserStatus(Snowflake id) const {
auto it = m_user_to_status.find(id);
if (it != m_user_to_status.end())