clear tabs when access lost, show blanks for missing channels

This commit is contained in:
ouwou
2022-05-06 01:14:15 -04:00
parent 7daa0a250c
commit 2c25319fb8
7 changed files with 68 additions and 7 deletions

View File

@@ -931,7 +931,10 @@ void ChannelList::OnChannelSubmenuPopup() {
const auto iter = m_model->get_iter(m_path_for_menu);
if (!iter) return;
const auto id = static_cast<Snowflake>((*iter)[m_columns.m_id]);
if (Abaddon::Get().GetDiscordClient().IsChannelMuted(id))
auto &discord = Abaddon::Get().GetDiscordClient();
const auto perms = discord.HasChannelPermission(discord.GetUserData().ID, id, Permission::VIEW_CHANNEL);
m_menu_channel_open_tab.set_sensitive(perms);
if (discord.IsChannelMuted(id))
m_menu_channel_toggle_mute.set_label("Unmute");
else
m_menu_channel_toggle_mute.set_label("Mute");