diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-25 03:07:11 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-25 03:07:11 -0500 |
commit | 207c00422861c91c553654a37c52e21f72c76cc2 (patch) | |
tree | 2cdb80fe62e54fd51fce29508800003d1df5bf26 /src/components/channelscellrenderer.cpp | |
parent | 36f73a6106a17463724e44fb5580dc2ee96d06ba (diff) | |
download | abaddon-portaudio-207c00422861c91c553654a37c52e21f72c76cc2.tar.gz abaddon-portaudio-207c00422861c91c553654a37c52e21f72c76cc2.zip |
take muted channels into account for unread guild indicator
Diffstat (limited to 'src/components/channelscellrenderer.cpp')
-rw-r--r-- | src/components/channelscellrenderer.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/components/channelscellrenderer.cpp b/src/components/channelscellrenderer.cpp index 788afdf..325d45a 100644 --- a/src/components/channelscellrenderer.cpp +++ b/src/components/channelscellrenderer.cpp @@ -250,20 +250,11 @@ void CellRendererChannels::render_vfunc_guild(const Cairo::RefPtr<Cairo::Context const auto id = m_property_id.get_value(); - int total_mentions = 0; auto &discord = Abaddon::Get().GetDiscordClient(); - const auto channels = discord.GetChannelsInGuild(id); - bool has_unread = false; - for (const auto &id : channels) { - const int state = Abaddon::Get().GetDiscordClient().GetUnreadStateForChannel(id); - if (state >= 0) { - has_unread = true; - total_mentions += state; - } - } - if (!has_unread) return; + int total_mentions; + const auto has_unread = discord.GetUnreadStateForGuild(id, total_mentions); - if (!discord.IsGuildMuted(id)) { + if (has_unread && !discord.IsGuildMuted(id)) { cr->set_source_rgb(1.0, 1.0, 1.0); const auto x = background_area.get_x(); const auto y = background_area.get_y(); |