summaryrefslogtreecommitdiff
path: root/src/components/channels.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-04-23 15:33:54 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-04-23 15:33:54 -0400
commitbfb2490938099982a2571bd07f4aab54128ce34a (patch)
tree8a5a591950b1f736858305f5111055ce8dd89f31 /src/components/channels.cpp
parentb4ab88f7086d87736848fc026bc87db651f8732e (diff)
downloadabaddon-portaudio-bfb2490938099982a2571bd07f4aab54128ce34a.tar.gz
abaddon-portaudio-bfb2490938099982a2571bd07f4aab54128ce34a.zip
dont expand channel list when changing tabs
Diffstat (limited to 'src/components/channels.cpp')
-rw-r--r--src/components/channels.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/channels.cpp b/src/components/channels.cpp
index 6e72725..2b83eb0 100644
--- a/src/components/channels.cpp
+++ b/src/components/channels.cpp
@@ -462,7 +462,7 @@ void ChannelList::OnGuildUnmute(Snowflake id) {
// create a temporary channel row for non-joined threads
// and delete them when the active channel switches off of them if still not joined
-void ChannelList::SetActiveChannel(Snowflake id) {
+void ChannelList::SetActiveChannel(Snowflake id, bool expand_to) {
// mark channel as read when switching off
if (m_active_channel.IsValid())
Abaddon::Get().GetDiscordClient().MarkChannelAsRead(m_active_channel, [](...) {});
@@ -479,11 +479,12 @@ void ChannelList::SetActiveChannel(Snowflake id) {
const auto channel_iter = GetIteratorForChannelFromID(id);
if (channel_iter) {
- m_view.expand_to_path(m_model->get_path(channel_iter));
+ if (expand_to) {
+ m_view.expand_to_path(m_model->get_path(channel_iter));
+ }
m_view.get_selection()->select(channel_iter);
} else {
m_view.get_selection()->unselect_all();
- // SetActiveChannel should probably just take the channel object
const auto channel = Abaddon::Get().GetDiscordClient().GetChannel(id);
if (!channel.has_value() || !channel->IsThread()) return;
auto parent_iter = GetIteratorForChannelFromID(*channel->ParentID);