diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-25 02:59:01 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-25 02:59:01 -0500 |
commit | 36f73a6106a17463724e44fb5580dc2ee96d06ba (patch) | |
tree | 0ba10012917902a6b3520b2c6d3aa1bde655f9fb /src | |
parent | 41d80af128cc74e538a2f5d2474ca49febc52c35 (diff) | |
download | abaddon-portaudio-36f73a6106a17463724e44fb5580dc2ee96d06ba.tar.gz abaddon-portaudio-36f73a6106a17463724e44fb5580dc2ee96d06ba.zip |
check view permissions for channels in read state
Diffstat (limited to 'src')
-rw-r--r-- | src/discord/discord.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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 |