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

@@ -610,7 +610,11 @@ void Abaddon::ActionChannelOpened(Snowflake id, bool expand_to) {
m_main_window->GetChatWindow()->SetTopic("");
const auto channel = m_discord.GetChannel(id);
if (!channel.has_value()) return;
if (!channel.has_value()) {
m_main_window->UpdateChatActiveChannel(Snowflake::Invalid, false);
m_main_window->UpdateChatWindowContents();
return;
}
const bool can_access = channel->IsDM() || m_discord.HasChannelPermission(m_discord.GetUserData().ID, id, Permission::VIEW_CHANNEL);