diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2024-01-11 21:28:55 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2024-01-11 21:28:55 -0500 |
commit | 09bf732a122760a1f1d6ba005d066d107c57edad (patch) | |
tree | 6066a7eef65f12b53961e24d1dd47040e440512f /src/components | |
parent | 615f2c80f1b0cfa7b72a08112ff4ef8ae23e5bf6 (diff) | |
download | abaddon-portaudio-09bf732a122760a1f1d6ba005d066d107c57edad.tar.gz abaddon-portaudio-09bf732a122760a1f1d6ba005d066d107c57edad.zip |
switch to correct guild on channel open in classic channels
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/channellist/channellist.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/channellist/channellist.cpp b/src/components/channellist/channellist.cpp index e4060a8..873de41 100644 --- a/src/components/channellist/channellist.cpp +++ b/src/components/channellist/channellist.cpp @@ -28,6 +28,14 @@ void ChannelList::UpdateListing() { } void ChannelList::SetActiveChannel(Snowflake id, bool expand_to) { + if (Abaddon::Get().GetSettings().ClassicChangeGuildOnOpen) { + if (const auto channel = Abaddon::Get().GetDiscordClient().GetChannel(id); channel.has_value() && channel->GuildID.has_value()) { + m_tree.SetSelectedGuild(*channel->GuildID); + } else { + m_tree.SetSelectedDMs(); + } + } + m_tree.SetActiveChannel(id, expand_to); } |