From ec8117a24b129b957a45f6f142221143b0f059a0 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 1 Nov 2020 00:13:52 -0400 Subject: update channel list selection when channel mention is clicked --- components/channels.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'components/channels.cpp') diff --git a/components/channels.cpp b/components/channels.cpp index fc409ad..a8f2f66 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -414,6 +414,12 @@ void ChannelList::Clear() { m_update_dispatcher.emit(); } +void ChannelList::SetActiveChannel(Snowflake id) { + auto it = m_id_to_row.find(id); + if (it == m_id_to_row.end()) return; + m_list->select_row(*it->second); +} + void ChannelList::CollapseRow(ChannelListRow *row) { row->Collapse(); for (auto child : row->Children) { -- cgit v1.2.3