mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-02 10:18:30 +00:00
Merge tag 'v4.14.2' into dev
# Conflicts: # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/core/version.h # Telegram/lib_ui
This commit is contained in:
@@ -1379,7 +1379,7 @@ void MainWidget::showHistory(
|
||||
|
||||
if (!back && (way != Way::ClearStack)) {
|
||||
// This may modify the current section, for example remove its contents.
|
||||
saveSectionInStack();
|
||||
saveSectionInStack(params);
|
||||
}
|
||||
|
||||
if (_history->peer()
|
||||
@@ -1501,13 +1501,23 @@ Ui::ChatTheme *MainWidget::customChatTheme() const {
|
||||
return _history->customChatTheme();
|
||||
}
|
||||
|
||||
void MainWidget::saveSectionInStack() {
|
||||
bool MainWidget::saveSectionInStack(
|
||||
const SectionShow ¶ms,
|
||||
Window::SectionWidget *newMainSection) {
|
||||
if (_mainSection) {
|
||||
if (auto memento = _mainSection->createMemento()) {
|
||||
if (params.dropSameFromStack
|
||||
&& newMainSection
|
||||
&& newMainSection->sameTypeAs(memento.get())) {
|
||||
// When choosing saved sublist we want to save the original
|
||||
// "Saved Messages" in the stack, but don't save every
|
||||
// sublist in a new stack entry when clicking them through.
|
||||
return false;
|
||||
}
|
||||
_stack.push_back(std::make_unique<StackItemSection>(
|
||||
std::move(memento)));
|
||||
} else {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
} else if (const auto history = _history->history()) {
|
||||
_stack.push_back(std::make_unique<StackItemHistory>(
|
||||
@@ -1515,7 +1525,7 @@ void MainWidget::saveSectionInStack() {
|
||||
_history->msgId(),
|
||||
_history->replyReturns()));
|
||||
} else {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
const auto raw = _stack.back().get();
|
||||
raw->setThirdSectionWeak(_thirdSection.data());
|
||||
@@ -1528,6 +1538,7 @@ void MainWidget::saveSectionInStack() {
|
||||
}
|
||||
}
|
||||
}, raw->lifetime());
|
||||
return true;
|
||||
}
|
||||
|
||||
void MainWidget::showSection(
|
||||
@@ -1730,7 +1741,11 @@ void MainWidget::showNewSection(
|
||||
|
||||
if (saveInStack) {
|
||||
// This may modify the current section, for example remove its contents.
|
||||
saveSectionInStack();
|
||||
if (!saveSectionInStack(params, newMainSection)) {
|
||||
saveInStack = false;
|
||||
animatedShow = false;
|
||||
animationParams = Window::SectionSlideParams();
|
||||
}
|
||||
}
|
||||
auto &settingSection = newThirdSection
|
||||
? _thirdSection
|
||||
@@ -2446,6 +2461,10 @@ auto MainWidget::thirdSectionForCurrentMainSection(
|
||||
return std::make_shared<Info::Memento>(
|
||||
peer,
|
||||
Info::Memento::DefaultSection(peer));
|
||||
} else if (const auto sublist = key.sublist()) {
|
||||
return std::make_shared<Info::Memento>(
|
||||
session().user(),
|
||||
Info::Memento::DefaultSection(session().user()));
|
||||
}
|
||||
Unexpected("Key in MainWidget::thirdSectionForCurrentMainSection().");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user