take muted channels into account for unread guild indicator

This commit is contained in:
ouwou
2021-12-25 03:07:11 -05:00
parent 36f73a6106
commit 207c004228
3 changed files with 19 additions and 13 deletions

View File

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