From 36f73a6106a17463724e44fb5580dc2ee96d06ba Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 25 Dec 2021 02:59:01 -0500 Subject: check view permissions for channels in read state --- src/discord/discord.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index 98cab9a..5443b87 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -2268,8 +2268,10 @@ void DiscordClient::HandleReadyReadState(const ReadyEventData &data) { for (const auto &entry : data.ReadState.Entries) { const auto it = m_last_message_id.find(entry.ID); if (it == m_last_message_id.end()) continue; - if (it->second > entry.LastMessageID) - m_unread[entry.ID] = entry.MentionCount; + if (it->second > entry.LastMessageID) { + if (HasChannelPermission(GetUserData().ID, entry.ID, Permission::VIEW_CHANNEL)) + m_unread[entry.ID] = entry.MentionCount; + } } // channels that arent in the read state are considered unread -- cgit v1.2.3