allow viewing all threads from within a thread

This commit is contained in:
ouwou
2021-08-22 01:36:49 -04:00
parent 69e03bbfb7
commit b0d609d386
2 changed files with 6 additions and 2 deletions

View File

@@ -626,8 +626,12 @@ void Abaddon::ActionViewPins(Snowflake channel_id) {
}
void Abaddon::ActionViewThreads(Snowflake channel_id) {
const auto data = m_discord.GetChannel(channel_id);
auto data = m_discord.GetChannel(channel_id);
if (!data.has_value()) return;
if (data->IsThread()) {
data = m_discord.GetChannel(*data->ParentID);
if (!data.has_value()) return;
}
auto window = new ThreadsWindow(*data);
ManageHeapWindow(window);
window->show();

View File

@@ -251,7 +251,7 @@ void MainWindow::OnViewSubmenuPopup(const Gdk::Rectangle* flipped_rect, const Gd
m_menu_view_pins.set_sensitive(false);
m_menu_view_threads.set_sensitive(false);
if (channel.has_value()) {
m_menu_view_threads.set_sensitive(channel->Type == ChannelType::GUILD_TEXT);
m_menu_view_threads.set_sensitive(channel->Type == ChannelType::GUILD_TEXT || channel->IsThread());
m_menu_view_pins.set_sensitive(channel->Type == ChannelType::GUILD_TEXT || channel->Type == ChannelType::DM || channel->Type == ChannelType::GROUP_DM);
}
}