summaryrefslogtreecommitdiff
path: root/src/components/channeltabswitcherhandy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/channeltabswitcherhandy.cpp')
-rw-r--r--src/components/channeltabswitcherhandy.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/channeltabswitcherhandy.cpp b/src/components/channeltabswitcherhandy.cpp
index f7b0226..67dbff0 100644
--- a/src/components/channeltabswitcherhandy.cpp
+++ b/src/components/channeltabswitcherhandy.cpp
@@ -37,6 +37,8 @@ ChannelTabSwitcherHandy::ChannelTabSwitcherHandy() {
discord.signal_message_ack().connect([this](const MessageAckData &data) {
CheckUnread(data.ChannelID);
});
+
+ discord.signal_channel_accessibility_changed().connect(sigc::mem_fun(*this, &ChannelTabSwitcherHandy::OnChannelAccessibilityChanged));
}
void ChannelTabSwitcherHandy::AddChannelTab(Snowflake id) {
@@ -195,6 +197,18 @@ void ChannelTabSwitcherHandy::AdvanceOnCurrent(size_t by) {
history->second.CurrentVisitedIndex = real;
}
+void ChannelTabSwitcherHandy::OnChannelAccessibilityChanged(Snowflake id, bool accessibility) {
+ if (accessibility) return;
+ if (auto it = m_pages.find(id); it != m_pages.end()) {
+ if (hdy_tab_page_get_selected(it->second))
+ if (!hdy_tab_view_select_previous_page(m_tab_view))
+ hdy_tab_view_select_next_page(m_tab_view);
+
+ hdy_tab_view_close_page(m_tab_view, it->second);
+ ClearPage(it->second);
+ }
+}
+
ChannelTabSwitcherHandy::type_signal_channel_switched_to ChannelTabSwitcherHandy::signal_channel_switched_to() {
return m_signal_channel_switched_to;
}