diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-08-28 02:43:02 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-08-28 02:43:02 -0400 |
commit | 66747ec753c5f9a617d8bd342fbf015f7137cf49 (patch) | |
tree | 2ab8e0cd2ad57caec0abd17c12fe237fdb5ec36e /components | |
parent | 8ed2cd65b6b49ad6bd4d91c0de71b4be863456b2 (diff) | |
download | abaddon-portaudio-66747ec753c5f9a617d8bd342fbf015f7137cf49.tar.gz abaddon-portaudio-66747ec753c5f9a617d8bd342fbf015f7137cf49.zip |
permissions check on archive/unarchive (oops)
Diffstat (limited to 'components')
-rw-r--r-- | components/channels.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/components/channels.cpp b/components/channels.cpp index 0a60fd6..4a3a8f1 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -708,10 +708,12 @@ void ChannelList::OnThreadSubmenuPopup(const Gdk::Rectangle *flipped_rect, const m_menu_thread_archive.set_visible(false); m_menu_thread_unarchive.set_visible(false); + auto &discord = Abaddon::Get().GetDiscordClient(); auto iter = m_model->get_iter(m_path_for_menu); if (!iter) return; - auto channel = Abaddon::Get().GetDiscordClient().GetChannel(static_cast<Snowflake>((*iter)[m_columns.m_id])); + auto channel = discord.GetChannel(static_cast<Snowflake>((*iter)[m_columns.m_id])); if (!channel.has_value() || !channel->ThreadMetadata.has_value()) return; + if (!discord.HasGuildPermission(discord.GetUserData().ID, *channel->GuildID, Permission::MANAGE_THREADS)) return; m_menu_thread_archive.set_visible(!channel->ThreadMetadata->IsArchived); m_menu_thread_unarchive.set_visible(channel->ThreadMetadata->IsArchived); |