mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Fix new forum layout search and topics list.
This commit is contained in:
@@ -1876,9 +1876,10 @@ bool SessionController::showForumInDifferentWindow(
|
||||
void SessionController::showForum(
|
||||
not_null<Data::Forum*> forum,
|
||||
const SectionShow ¶ms) {
|
||||
const auto forced = params.forceTopicsList;
|
||||
if (showForumInDifferentWindow(forum, params)) {
|
||||
return;
|
||||
} else if (forum->channel()->useSubsectionTabs()) {
|
||||
} else if (!forced && forum->channel()->useSubsectionTabs()) {
|
||||
if (const auto active = forum->activeSubsectionThread()) {
|
||||
showThread(active, ShowAtUnreadMsgId, params);
|
||||
} else {
|
||||
@@ -1914,20 +1915,26 @@ void SessionController::showForum(
|
||||
});
|
||||
}
|
||||
};
|
||||
content()->showForum(forum, params);
|
||||
if (_shownForum.current() != forum) {
|
||||
return;
|
||||
}
|
||||
|
||||
forum->destroyed(
|
||||
) | rpl::start_with_next([=] {
|
||||
closeAndShowHistory(false);
|
||||
}, _shownForumLifetime);
|
||||
using FlagChange = Data::Flags<ChannelDataFlags>::Change;
|
||||
forum->channel()->flagsValue(
|
||||
) | rpl::start_with_next([=](FlagChange change) {
|
||||
if (change.diff & ChannelDataFlag::ForumTabs) {
|
||||
if (HistoryView::SubsectionTabs::UsedFor(history)) {
|
||||
closeAndShowHistory(true);
|
||||
if (!forced) {
|
||||
using FlagChange = Data::Flags<ChannelDataFlags>::Change;
|
||||
forum->channel()->flagsValue(
|
||||
) | rpl::start_with_next([=](FlagChange change) {
|
||||
if (change.diff & ChannelDataFlag::ForumTabs) {
|
||||
if (HistoryView::SubsectionTabs::UsedFor(history)) {
|
||||
closeAndShowHistory(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, _shownForumLifetime);
|
||||
content()->showForum(forum, params);
|
||||
}, _shownForumLifetime);
|
||||
}
|
||||
}
|
||||
|
||||
void SessionController::closeForum() {
|
||||
|
||||
Reference in New Issue
Block a user