diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-01-08 20:03:12 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-01-08 20:03:12 -0500 |
commit | 604f2ffe3dc8978aebd6aa819b73374aa32d2f0e (patch) | |
tree | f2465bc8ba190607037062a63187a10eb58ebf4a /src/discord/discord.cpp | |
parent | 4e0b22375fe10c6b9e27708ece21bf7da569bda4 (diff) | |
download | abaddon-portaudio-604f2ffe3dc8978aebd6aa819b73374aa32d2f0e.tar.gz abaddon-portaudio-604f2ffe3dc8978aebd6aa819b73374aa32d2f0e.zip |
show count of unread dms in header
Diffstat (limited to 'src/discord/discord.cpp')
-rw-r--r-- | src/discord/discord.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index dce5124..5b3cdb5 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -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()) |