Remove showing monoforums inside dialogs widget.

This commit is contained in:
John Preston 2025-05-30 17:40:09 +04:00
parent 0d43f16db2
commit 50b761fab2
11 changed files with 24 additions and 283 deletions

View file

@ -781,55 +781,11 @@ void InnerWidget::changeOpenedForum(Data::Forum *forum) {
} }
} }
void InnerWidget::changeOpenedMonoforum(Data::SavedMessages *monoforum) { void InnerWidget::showSavedSublists() {
if (_savedSublists == monoforum) {
return;
}
stopReorderPinned();
clearSelection();
if (monoforum) {
saveChatsFilterScrollState(_filterId);
}
_filterId = monoforum
? 0
: _controller->activeChatsFilterCurrent();
if (_openedForum) {
// If we close it inside forum destruction we should not schedule.
session().data().forumIcons().scheduleUserpicsReset(_openedForum);
}
_savedSublists = monoforum;
_st = &st::defaultDialogRow;
refreshShownList();
_openedForumLifetime.destroy();
if (monoforum) {
rpl::merge(
monoforum->chatsListChanges(),
monoforum->chatsListLoadedEvents()
) | rpl::start_with_next([=] {
refresh();
}, _openedForumLifetime);
}
refreshWithCollapsedRows(true);
if (_loadMoreCallback) {
_loadMoreCallback();
}
if (!monoforum) {
restoreChatsFilterScrollState(_filterId);
}
}
void InnerWidget::showSavedSublists(ChannelData *parentChat) {
Expects(!parentChat || parentChat->monoforum());
Expects(!_geometryInited); Expects(!_geometryInited);
Expects(!_savedSublists); Expects(!_savedSublists);
_savedSublists = parentChat _savedSublists = &session().data().savedMessages();
? parentChat->monoforum()
: &session().data().savedMessages();
stopReorderPinned(); stopReorderPinned();
clearSelection(); clearSelection();

View file

@ -141,8 +141,7 @@ public:
void changeOpenedFolder(Data::Folder *folder); void changeOpenedFolder(Data::Folder *folder);
void changeOpenedForum(Data::Forum *forum); void changeOpenedForum(Data::Forum *forum);
void changeOpenedMonoforum(Data::SavedMessages *monoforum); void showSavedSublists();
void showSavedSublists(ChannelData *parentChat);
void selectSkip(int32 direction); void selectSkip(int32 direction);
void selectSkipPage(int32 pixels, int32 direction); void selectSkipPage(int32 pixels, int32 direction);

View file

@ -79,7 +79,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_changes.h" #include "data/data_changes.h"
#include "data/data_download_manager.h" #include "data/data_download_manager.h"
#include "data/data_chat_filters.h" #include "data/data_chat_filters.h"
#include "data/data_saved_messages.h"
#include "data/data_saved_sublist.h" #include "data/data_saved_sublist.h"
#include "data/data_stories.h" #include "data/data_stories.h"
#include "info/downloads/info_downloads_widget.h" #include "info/downloads/info_downloads_widget.h"
@ -420,8 +419,6 @@ Widget::Widget(
) | rpl::filter([=](const Data::HistoryUpdate &update) { ) | rpl::filter([=](const Data::HistoryUpdate &update) {
if (_openedForum) { if (_openedForum) {
return (update.history == _openedForum->history()); return (update.history == _openedForum->history());
} else if (_openedMonoforum) {
return (update.history->peer == _openedMonoforum->parentChat());
} else if (_openedFolder) { } else if (_openedFolder) {
return (update.history->folder() == _openedFolder) return (update.history->folder() == _openedFolder)
&& !update.history->isPinnedDialog(FilterId()); && !update.history->isPinnedDialog(FilterId());
@ -600,7 +597,6 @@ Widget::Widget(
_search->setFocusFast(); _search->setFocusFast();
if (_childList) { if (_childList) {
controller->closeForum(); controller->closeForum();
controller->closeMonoforum();
} }
}); });
@ -623,8 +619,6 @@ Widget::Widget(
searchMore(); searchMore();
} else if (_openedForum && state == WidgetState::Default) { } else if (_openedForum && state == WidgetState::Default) {
_openedForum->requestTopics(); _openedForum->requestTopics();
} else if (_openedMonoforum && state == WidgetState::Default) {
_openedMonoforum->loadMore();
} else { } else {
const auto folder = _inner->shownFolder(); const auto folder = _inner->shownFolder();
if (!folder || !folder->chatsList()->loaded()) { if (!folder || !folder->chatsList()->loaded()) {
@ -673,16 +667,7 @@ Widget::Widget(
) | rpl::filter(!rpl::mappers::_1) | rpl::start_with_next([=] { ) | rpl::filter(!rpl::mappers::_1) | rpl::start_with_next([=] {
if (_openedForum) { if (_openedForum) {
changeOpenedForum(nullptr, anim::type::normal); changeOpenedForum(nullptr, anim::type::normal);
} else if (_childList && !_childList->openedMonoforum()) { } else if (_childList) {
closeChildList(anim::type::normal);
}
}, lifetime());
controller->shownMonoforum().changes(
) | rpl::filter(!rpl::mappers::_1) | rpl::start_with_next([=] {
if (_openedMonoforum) {
changeOpenedMonoforum(nullptr, anim::type::normal);
} else if (_childList && !_childList->openedForum()) {
closeChildList(anim::type::normal); closeChildList(anim::type::normal);
} }
}, lifetime()); }, lifetime());
@ -811,7 +796,7 @@ void Widget::setupSwipeBack() {
} }
}); });
} }
if (controller()->shownForum().current()) { // #TODO monoforum if (controller()->shownForum().current()) {
if (!isRightToLeft) { if (!isRightToLeft) {
return Ui::Controls::SwipeHandlerFinishData(); return Ui::Controls::SwipeHandlerFinishData();
} }
@ -932,7 +917,8 @@ void Widget::chosenRow(const ChosenRow &row) {
controller()->showForum( controller()->showForum(
forum, forum,
Window::SectionShow().withChildColumn()); Window::SectionShow().withChildColumn());
if (forum->channel()->viewForumAsMessages()) { if (controller()->shownForum().current() == forum
&& forum->channel()->viewForumAsMessages()) {
controller()->showThread( controller()->showThread(
history, history,
ShowAtUnreadMsgId, ShowAtUnreadMsgId,
@ -940,27 +926,6 @@ void Widget::chosenRow(const ChosenRow &row) {
} }
} }
return; return;
//} else if (history
// && history->peer->amMonoforumAdmin()
// && !row.message.fullId) {
// const auto monoforum = history->peer->monoforum();
// if (controller()->shownMonoforum().current() == monoforum) {
// controller()->closeMonoforum();
// //} else if (row.newWindow) { // #TODO monoforum
// // controller()->showInNewWindow(
// // Window::SeparateId(Window::SeparateType::Forum, history));
// } else {
// controller()->showMonoforum(
// monoforum,
// Window::SectionShow().withChildColumn());
// if (!controller()->adaptive().isOneColumn()) {
// controller()->showThread(
// history,
// ShowAtUnreadMsgId,
// Window::SectionShow::Way::ClearStack);
// }
// }
// return;
} else if (history) { } else if (history) {
const auto peer = history->peer; const auto peer = history->peer;
const auto showAtMsgId = controller()->uniqueChatsInSearchResults() const auto showAtMsgId = controller()->uniqueChatsInSearchResults()
@ -995,21 +960,6 @@ void Widget::chosenRow(const ChosenRow &row) {
} }
controller()->openFolder(folder); controller()->openFolder(folder);
hideChildList(); hideChildList();
} else if (const auto sublist = row.key.sublist()) {
using namespace Window;
auto params = SectionShow(SectionShow::Way::Forward);
params.dropSameFromStack = true;
params.highlightPart.text = _searchState.query;
if (!params.highlightPart.empty()) {
params.highlightPartOffsetHint = kSearchQueryOffsetHint;
}
if (false && row.newWindow) { // #TODO monoforum
controller()->showInNewWindow(
Window::SeparateId(sublist),
row.message.fullId.msg);
} else {
controller()->showThread(sublist, row.message.fullId.msg, params);
}
} }
if (row.filteredRow && !session().supportMode()) { if (row.filteredRow && !session().supportMode()) {
if (_subsectionTopBar) { if (_subsectionTopBar) {
@ -1084,8 +1034,7 @@ void Widget::setupTopBarSuggestions(not_null<Ui::VerticalLayout*> dialogs) {
) | rpl::filter(_1 == nullptr) | rpl::map([=] { ) | rpl::filter(_1 == nullptr) | rpl::map([=] {
auto on = rpl::combine( auto on = rpl::combine(
controller()->activeChatsFilter(), controller()->activeChatsFilter(),
_openedFolderOrForumOrMonoforumChanges.events_starting_with( _openedFolderOrForumChanges.events_starting_with(false),
false),
widthValue() | rpl::map( widthValue() | rpl::map(
_1 >= st::columnMinimalWidthLeft _1 >= st::columnMinimalWidthLeft
) | rpl::distinct_until_changed(), ) | rpl::distinct_until_changed(),
@ -1094,11 +1043,11 @@ void Widget::setupTopBarSuggestions(not_null<Ui::VerticalLayout*> dialogs) {
_jumpToDate->toggledValue() _jumpToDate->toggledValue()
) | rpl::map([=]( ) | rpl::map([=](
FilterId id, FilterId id,
bool folderOrForumOrMonoforum, bool folderOrForum,
bool wide, bool wide,
bool search, bool search,
bool searchInPeer) { bool searchInPeer) {
return !folderOrForumOrMonoforum return !folderOrForum
&& wide && wide
&& !search && !search
&& !searchInPeer && !searchInPeer
@ -1155,8 +1104,7 @@ void Widget::updateFrozenAccountBar() {
void Widget::updateTopBarSuggestions() { void Widget::updateTopBarSuggestions() {
if (_topBarSuggestion) { if (_topBarSuggestion) {
_openedFolderOrForumOrMonoforumChanges.fire( _openedFolderOrForumChanges.fire(_openedFolder || _openedForum);
_openedFolder || _openedForum || _openedMonoforum);
} }
} }
@ -1594,7 +1542,7 @@ void Widget::updateControlsVisibility(bool fast) {
if (_chatFilters) { if (_chatFilters) {
_chatFilters->setVisible(!_openedForum); _chatFilters->setVisible(!_openedForum);
} }
if (_openedFolder || _openedForum || _openedMonoforum) { if (_openedFolder || _openedForum) {
_subsectionTopBar->show(); _subsectionTopBar->show();
if (_forumTopShadow) { if (_forumTopShadow) {
_forumTopShadow->show(); _forumTopShadow->show();
@ -1973,29 +1921,6 @@ void Widget::changeOpenedForum(Data::Forum *forum, anim::type animated) {
}, (forum != nullptr), animated); }, (forum != nullptr), animated);
} }
void Widget::changeOpenedMonoforum(
Data::SavedMessages *monoforum,
anim::type animated) {
if (_openedMonoforum == monoforum) {
return;
}
changeOpenedSubsection([&] {
cancelSearch({ .forceFullCancel = true });
closeChildList(anim::type::instant);
_openedMonoforum = monoforum;
_searchState.tab = monoforum
? ChatSearchTab::ThisPeer
: ChatSearchTab::MyMessages;
_searchWithPostsPreview = computeSearchWithPostsPreview();
_api.request(base::take(_topicSearchRequest)).cancel();
_inner->changeOpenedMonoforum(monoforum);
storiesToggleExplicitExpand(false);
updateFrozenAccountBar();
updateTopBarSuggestions();
updateStoriesVisibility();
}, (monoforum != nullptr), animated);
}
void Widget::hideChildList() { void Widget::hideChildList() {
if (_childList) { if (_childList) {
controller()->closeForum(); controller()->closeForum();
@ -2003,7 +1928,7 @@ void Widget::hideChildList() {
} }
void Widget::refreshTopBars() { void Widget::refreshTopBars() {
if (_openedFolder || _openedForum || _openedMonoforum) { if (_openedFolder || _openedForum) {
if (!_subsectionTopBar) { if (!_subsectionTopBar) {
_subsectionTopBar.create(this, controller()); _subsectionTopBar.create(this, controller());
if (_stories) { if (_stories) {
@ -2033,12 +1958,10 @@ void Widget::refreshTopBars() {
} }
const auto history = _openedForum const auto history = _openedForum
? _openedForum->history().get() ? _openedForum->history().get()
: _openedMonoforum
? session().data().history(_openedMonoforum->parentChat()).get()
: nullptr; : nullptr;
_subsectionTopBar->setActiveChat( _subsectionTopBar->setActiveChat(
HistoryView::TopBarWidget::ActiveChat{ HistoryView::TopBarWidget::ActiveChat{
.key = ((_openedForum || _openedMonoforum) .key = (_openedForum
? Dialogs::Key(history) ? Dialogs::Key(history)
: Dialogs::Key(_openedFolder)), : Dialogs::Key(_openedFolder)),
.section = Dialogs::EntryState::Section::ChatsList, .section = Dialogs::EntryState::Section::ChatsList,
@ -2204,10 +2127,6 @@ Data::Forum *Widget::openedForum() const {
return _openedForum; return _openedForum;
} }
Data::SavedMessages *Widget::openedMonoforum() const {
return _openedMonoforum;
}
void Widget::jumpToTop(bool belowPinned) { void Widget::jumpToTop(bool belowPinned) {
if (session().supportMode()) { if (session().supportMode()) {
return; return;
@ -2506,15 +2425,6 @@ void Widget::escape() {
} else if (initial != forum) { } else if (initial != forum) {
controller()->showForum(initial); controller()->showForum(initial);
} }
} else if (const auto monoforum
= controller()->shownMonoforum().current()) {
const auto id = controller()->windowId(); // #TODO monoforum
const auto initial = (Data::SavedMessages*)nullptr;
if (!initial) {
controller()->closeMonoforum();
} else if (initial != monoforum) {
controller()->showMonoforum(initial);
}
} else if (controller()->openedFolder().current()) { } else if (controller()->openedFolder().current()) {
if (!controller()->windowId().folder()) { if (!controller()->windowId().folder()) {
controller()->closeFolder(); controller()->closeFolder();
@ -3379,33 +3289,12 @@ void Widget::showForum(
return; return;
} }
cancelSearch({ .forceFullCancel = true }); cancelSearch({ .forceFullCancel = true });
openChildList(forum, nullptr, params); openChildList(forum, params);
}
void Widget::showMonoforum(
not_null<Data::SavedMessages*> monoforum,
const Window::SectionShow &params) {
if (_openedMonoforum == monoforum) {
return;
}
const auto nochat = !controller()->mainSectionShown();
if (!params.childColumn
|| (Core::App().settings().dialogsWidthRatio(nochat) == 0.)
|| (_layout != Layout::Main)
|| OptionForumHideChatsList.value()) {
changeOpenedMonoforum(monoforum, params.animated);
return;
}
cancelSearch({ .forceFullCancel = true });
openChildList(nullptr, monoforum, params);
} }
void Widget::openChildList( void Widget::openChildList(
Data::Forum *forum, not_null<Data::Forum*> forum,
Data::SavedMessages *monoforum,
const Window::SectionShow &params) { const Window::SectionShow &params) {
Expects(forum || monoforum);
auto slide = Window::SectionSlideParams(); auto slide = Window::SectionSlideParams();
const auto animated = !_childList const auto animated = !_childList
&& (params.animated == anim::type::normal); && (params.animated == anim::type::normal);
@ -3426,13 +3315,8 @@ void Widget::openChildList(
this, this,
controller(), controller(),
Layout::Child); Layout::Child);
if (forum) { _childList->showForum(forum, copy);
_childList->showForum(forum, copy); _childListPeerId = forum->channel()->id;
_childListPeerId = forum->channel()->id;
} else {
_childList->showMonoforum(monoforum, copy);
_childListPeerId = monoforum->parentChat()->id;
}
} }
_childListShadow = std::make_unique<Ui::RpWidget>(this); _childListShadow = std::make_unique<Ui::RpWidget>(this);
@ -4289,10 +4173,6 @@ PeerData *Widget::searchInPeer() const {
? nullptr ? nullptr
: _openedForum : _openedForum
? _openedForum->channel().get() ? _openedForum->channel().get()
: _openedMonoforum
? (_openedMonoforum->parentChat()
? _openedMonoforum->parentChat()
: (PeerData*)session().user().get())
: _searchState.inChat.sublist() : _searchState.inChat.sublist()
? _searchState.inChat.sublist()->owningHistory()->peer.get() ? _searchState.inChat.sublist()->owningHistory()->peer.get()
: _searchState.inChat.peer(); : _searchState.inChat.peer();

View file

@ -23,7 +23,6 @@ class Error;
namespace Data { namespace Data {
class Forum; class Forum;
class SavedMessages;
enum class StorySourcesList : uchar; enum class StorySourcesList : uchar;
struct ReactionId; struct ReactionId;
} // namespace Data } // namespace Data
@ -109,14 +108,10 @@ public:
void showForum( void showForum(
not_null<Data::Forum*> forum, not_null<Data::Forum*> forum,
const Window::SectionShow &params); const Window::SectionShow &params);
void showMonoforum(
not_null<Data::SavedMessages*> monoforum,
const Window::SectionShow &params);
void setInnerFocus(bool unfocusSearch = false); void setInnerFocus(bool unfocusSearch = false);
[[nodiscard]] bool searchHasFocus() const; [[nodiscard]] bool searchHasFocus() const;
[[nodiscard]] Data::Forum *openedForum() const; [[nodiscard]] Data::Forum *openedForum() const;
[[nodiscard]] Data::SavedMessages *openedMonoforum() const;
void jumpToTop(bool belowPinned = false); void jumpToTop(bool belowPinned = false);
void raiseWithTooltip(); void raiseWithTooltip();
@ -254,9 +249,6 @@ private:
anim::type animated); anim::type animated);
void changeOpenedFolder(Data::Folder *folder, anim::type animated); void changeOpenedFolder(Data::Folder *folder, anim::type animated);
void changeOpenedForum(Data::Forum *forum, anim::type animated); void changeOpenedForum(Data::Forum *forum, anim::type animated);
void changeOpenedMonoforum(
Data::SavedMessages *monoforum,
anim::type animated);
void hideChildList(); void hideChildList();
void destroyChildListCanvas(); void destroyChildListCanvas();
[[nodiscard]] QPixmap grabForFolderSlideAnimation(); [[nodiscard]] QPixmap grabForFolderSlideAnimation();
@ -266,8 +258,7 @@ private:
Window::SlideDirection direction); Window::SlideDirection direction);
void openChildList( void openChildList(
Data::Forum *forum, not_null<Data::Forum*> forum,
Data::SavedMessages *monoforum,
const Window::SectionShow &params); const Window::SectionShow &params);
void closeChildList(anim::type animated); void closeChildList(anim::type animated);
@ -343,7 +334,7 @@ private:
Ui::SlideWrap<Ui::RpWidget> *_topBarSuggestion = nullptr; Ui::SlideWrap<Ui::RpWidget> *_topBarSuggestion = nullptr;
rpl::event_stream<int> _topBarSuggestionHeightChanged; rpl::event_stream<int> _topBarSuggestionHeightChanged;
rpl::event_stream<bool> _searchStateForTopBarSuggestion; rpl::event_stream<bool> _searchStateForTopBarSuggestion;
rpl::event_stream<bool> _openedFolderOrForumOrMonoforumChanges; rpl::event_stream<bool> _openedFolderOrForumChanges;
object_ptr<Ui::ElasticScroll> _scroll; object_ptr<Ui::ElasticScroll> _scroll;
QPointer<InnerWidget> _inner; QPointer<InnerWidget> _inner;
@ -369,7 +360,6 @@ private:
Data::Folder *_openedFolder = nullptr; Data::Folder *_openedFolder = nullptr;
Data::Forum *_openedForum = nullptr; Data::Forum *_openedForum = nullptr;
Data::SavedMessages *_openedMonoforum = nullptr;
SearchState _searchState; SearchState _searchState;
History *_searchInMigrated = nullptr; History *_searchInMigrated = nullptr;
rpl::lifetime _searchTagsLifetime; rpl::lifetime _searchTagsLifetime;

View file

@ -773,10 +773,6 @@ void TopBarWidget::backClicked() {
&& _activeChat.key.history() && _activeChat.key.history()
&& _activeChat.key.history()->isForum()) { && _activeChat.key.history()->isForum()) {
_controller->closeForum(); _controller->closeForum();
} else if (_activeChat.section == Section::ChatsList
&& _activeChat.key.history()
&& _activeChat.key.history()->amMonoforumAdmin()) {
_controller->closeMonoforum();
} else { } else {
_controller->showBackFromStack(); _controller->showBackFromStack();
} }

View file

@ -58,7 +58,7 @@ SublistsWidget::SublistsWidget(
this, this,
controller->parentController(), controller->parentController(),
rpl::single(Dialogs::InnerWidget::ChildListShown()))); rpl::single(Dialogs::InnerWidget::ChildListShown())));
_list->showSavedSublists(nullptr); _list->showSavedSublists();
_list->setNarrowRatio(0.); _list->setNarrowRatio(0.);
_list->chosenRow() | rpl::start_with_next([=](Dialogs::ChosenRow row) { _list->chosenRow() | rpl::start_with_next([=](Dialogs::ChosenRow row) {

View file

@ -1594,18 +1594,6 @@ void MainWidget::showForum(
} }
} }
void MainWidget::showMonoforum(
not_null<Data::SavedMessages*> monoforum,
const SectionShow &params) {
Expects(_dialogs != nullptr);
_dialogs->showMonoforum(monoforum, params);
if (params.activation != anim::activation::background) {
_controller->window().hideSettingsAndLayer();
}
}
PeerData *MainWidget::peer() const { PeerData *MainWidget::peer() const {
return _history->peer(); return _history->peer();
} }

View file

@ -199,9 +199,6 @@ public:
not_null<const HistoryItem*> item, not_null<const HistoryItem*> item,
const SectionShow &params); const SectionShow &params);
void showForum(not_null<Data::Forum*> forum, const SectionShow &params); void showForum(not_null<Data::Forum*> forum, const SectionShow &params);
void showMonoforum(
not_null<Data::SavedMessages*> monoforum,
const SectionShow &params);
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo); bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);

View file

@ -605,15 +605,10 @@ void SessionNavigation::showPeerByLinkResolved(
showPeerInfo(peer, params); showPeerInfo(peer, params);
} else if (resolveType == ResolveType::HashtagSearch) { } else if (resolveType == ResolveType::HashtagSearch) {
searchMessages(info.text, peer->owner().history(peer)); searchMessages(info.text, peer->owner().history(peer));
} else if ((peer->isForum() || peer->amMonoforumAdmin()) } else if (peer->isForum() && resolveType != ResolveType::Boost) {
&& resolveType != ResolveType::Boost) {
const auto itemId = info.messageId; const auto itemId = info.messageId;
if (!itemId) { if (!itemId) {
if (peer->isForum()) { parentController()->showForum(peer->forum(), params);
parentController()->showForum(peer->forum(), params);
} else {
parentController()->showMonoforum(peer->monoforum(), params);
}
} else if (const auto item = peer->owner().message(peer, itemId)) { } else if (const auto item = peer->owner().message(peer, itemId)) {
showMessageByLinkResolved(item, info); showMessageByLinkResolved(item, info);
} else { } else {
@ -1929,7 +1924,6 @@ void SessionController::showForum(
} }
}, _shownForumLifetime); }, _shownForumLifetime);
content()->showForum(forum, params); content()->showForum(forum, params);
closeMonoforum();
} }
void SessionController::closeForum() { void SessionController::closeForum() {
@ -1980,57 +1974,6 @@ const rpl::variable<Data::Forum*> &SessionController::shownForum() const {
return _shownForum; return _shownForum;
} }
void SessionController::showMonoforum(
not_null<Data::SavedMessages*> monoforum,
const SectionShow &params) {
// if (showForumInDifferentWindow(forum, params)) {
// return;
// }
_shownMonoforumLifetime.destroy();
if (_shownMonoforum.current() != monoforum) {
resetFakeUnreadWhileOpened();
}
if (monoforum
&& _activeChatEntry.current().key.peer()
&& adaptive().isOneColumn()) {
clearSectionStack(params);
}
_shownMonoforum = monoforum.get();
if (_shownMonoforum.current() != monoforum) {
return;
}
monoforum->destroyed(
) | rpl::start_with_next([=] {
closeMonoforum();
}, _shownMonoforumLifetime);
content()->showMonoforum(monoforum, params);
closeForum();
}
void SessionController::closeMonoforum() {
if (const auto monoforum = _shownMonoforum.current()) {
const auto id = windowId();
if (id.type == SeparateType::SavedSublist) {
const auto initial = id.parentChat;
if (!initial
|| !initial->monoforum()
|| initial == monoforum->parentChat()) {
Core::App().closeWindow(_window);
} else {
showMonoforum(initial->monoforum());
}
return;
}
}
_shownMonoforumLifetime.destroy();
_shownMonoforum = nullptr;
}
auto SessionController::shownMonoforum() const
-> const rpl::variable<Data::SavedMessages*> & {
return _shownMonoforum;
}
void SessionController::setActiveChatEntry(Dialogs::RowDescriptor row) { void SessionController::setActiveChatEntry(Dialogs::RowDescriptor row) {
if (windowId().type == SeparateType::SharedMedia) { if (windowId().type == SeparateType::SharedMedia) {
return; return;

View file

@ -415,12 +415,6 @@ public:
void closeForum(); void closeForum();
const rpl::variable<Data::Forum*> &shownForum() const; const rpl::variable<Data::Forum*> &shownForum() const;
void showMonoforum(
not_null<Data::SavedMessages*> monoforum,
const SectionShow &params = SectionShow::Way::ClearStack);
void closeMonoforum();
const rpl::variable<Data::SavedMessages*> &shownMonoforum() const;
void setActiveChatEntry(Dialogs::RowDescriptor row); void setActiveChatEntry(Dialogs::RowDescriptor row);
void setActiveChatEntry(Dialogs::Key key); void setActiveChatEntry(Dialogs::Key key);
Dialogs::RowDescriptor activeChatEntryCurrent() const; Dialogs::RowDescriptor activeChatEntryCurrent() const;
@ -770,8 +764,6 @@ private:
rpl::variable<Data::Folder*> _openedFolder; rpl::variable<Data::Folder*> _openedFolder;
rpl::variable<Data::Forum*> _shownForum; rpl::variable<Data::Forum*> _shownForum;
rpl::lifetime _shownForumLifetime; rpl::lifetime _shownForumLifetime;
rpl::variable<Data::SavedMessages*> _shownMonoforum;
rpl::lifetime _shownMonoforumLifetime;
rpl::event_stream<> _filtersMenuChanged; rpl::event_stream<> _filtersMenuChanged;

@ -1 +1 @@
Subproject commit 369d8b5172b6f70a3a9b2363cfa0f4fc5f620f56 Subproject commit 2b0d129b528bb56a71ebcf1f8c0a4d8b19123e34