Merge tag 'v5.2.2' into dev

This commit is contained in:
AlexeyZavar
2024-07-02 22:53:41 +03:00
51 changed files with 408 additions and 176 deletions
@@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_controller.h"
#include "window/window_filters_menu.h"
#include "window/window_separate_id.h"
#include "info/channel_statistics/earn/info_earn_inner_widget.h"
#include "info/channel_statistics/earn/info_channel_earn_list.h"
#include "info/info_memento.h"
#include "info/info_controller.h"
#include "inline_bots/bot_attach_web_view.h"
@@ -1668,8 +1668,9 @@ void SessionController::showForum(
) | rpl::start_with_next([=, history = forum->history()] {
const auto now = activeChatCurrent().owningHistory();
const auto showHistory = !now || (now == history);
const auto weak = base::make_weak(this);
closeForum();
if (showHistory) {
if (weak && showHistory) {
showPeerHistory(history, {
SectionShow::Way::Backward,
anim::type::normal,
@@ -1684,7 +1685,7 @@ void SessionController::closeForum() {
if (const auto forum = _shownForum.current()) {
const auto id = windowId();
if (id.type == SeparateType::Forum) {
const auto initial = id.thread->asForum();
const auto initial = id.forum();
if (!initial || initial == forum) {
Core::App().closeWindow(_window);
} else {
@@ -2537,7 +2538,13 @@ void SessionController::showBackFromStack(const SectionShow &params) {
return topic && topic->forum()->topicDeleted(topic->rootId());
};
do {
content()->showBackFromStack(params);
const auto empty = content()->stackIsEmpty();
const auto shown = content()->showBackFromStack(params);
if (empty && !shown && content()->stackIsEmpty() && bad()) {
clearSectionStack(anim::type::instant);
window().close();
break;
}
} while (bad());
}