From 906fc9cc1d85fdc0c9ee78803d3b9aa6d0ecebe6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 21 Mar 2025 18:56:43 +0400 Subject: [PATCH] Show more frozen errors. --- Telegram/SourceFiles/core/local_url_handlers.cpp | 4 ++++ .../SourceFiles/settings/settings_information.cpp | 11 ++++++++++- Telegram/SourceFiles/settings/settings_main.cpp | 3 +++ Telegram/SourceFiles/ui/controls/userpic_button.cpp | 4 ++++ Telegram/SourceFiles/window/window_main_menu.cpp | 4 +++- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 66ff7370a4..76a4c1aba7 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -911,6 +911,8 @@ bool ShowEditBirthday( const QVariant &context) { if (!controller) { return false; + } else if (controller->showFrozenError()) { + return true; } const auto user = controller->session().user(); const auto save = [=](Data::Birthday result) { @@ -967,6 +969,8 @@ bool ShowEditPersonalChannel( const QVariant &context) { if (!controller) { return false; + } else if (controller->showFrozenError()) { + return true; } auto listController = std::make_unique( diff --git a/Telegram/SourceFiles/settings/settings_information.cpp b/Telegram/SourceFiles/settings/settings_information.cpp index a087aed742..898673ba39 100644 --- a/Telegram/SourceFiles/settings/settings_information.cpp +++ b/Telegram/SourceFiles/settings/settings_information.cpp @@ -453,12 +453,18 @@ void SetupRows( Ui::AddSkip(container); + const auto showEditName = [=] { + if (controller->showFrozenError()) { + return; + } + controller->show(Box(self)); + }; AddRow( container, tr::lng_settings_name_label(), Info::Profile::NameValue(self) | Ui::Text::ToWithEntities(), tr::lng_profile_copy_fullname(tr::now), - [=] { controller->show(Box(self)); }, + showEditName, { &st::menuIconProfile }); const auto showChangePhone = [=] { @@ -508,6 +514,9 @@ void SetupRows( std::move(value), tr::lng_context_copy_mention(tr::now), [=] { + if (controller->showFrozenError()) { + return; + } const auto box = controller->show( Box(UsernamesBox, session->user())); box->boxClosing( diff --git a/Telegram/SourceFiles/settings/settings_main.cpp b/Telegram/SourceFiles/settings/settings_main.cpp index 239f669ae3..a7b96d7c96 100644 --- a/Telegram/SourceFiles/settings/settings_main.cpp +++ b/Telegram/SourceFiles/settings/settings_main.cpp @@ -229,6 +229,9 @@ void Cover::initViewers() { }, lifetime()); _username->overrideLinkClickHandler([=] { + if (_controller->showFrozenError()) { + return; + } const auto username = _user->username(); if (username.isEmpty()) { _controller->show(Box(UsernamesBox, _user)); diff --git a/Telegram/SourceFiles/ui/controls/userpic_button.cpp b/Telegram/SourceFiles/ui/controls/userpic_button.cpp index dec06a911e..39faf9ca80 100644 --- a/Telegram/SourceFiles/ui/controls/userpic_button.cpp +++ b/Telegram/SourceFiles/ui/controls/userpic_button.cpp @@ -276,6 +276,10 @@ void UserpicButton::setClickHandlerByRole() { void UserpicButton::choosePhotoLocally() { if (!_window) { return; + } else if (const auto controller = _window->sessionController()) { + if (controller->showFrozenError()) { + return; + } } const auto callback = [=](ChosenType type) { return [=](QImage &&image) { diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index 9ae782dbbc..0fd4094309 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -894,7 +894,9 @@ void MainMenu::updateInnerControlsGeometry() { } void MainMenu::chooseEmojiStatus() { - if (const auto widget = _badge->widget()) { + if (_controller->showFrozenError()) { + return; + } else if (const auto widget = _badge->widget()) { _emojiStatusPanel->show(_controller, widget, _badge->sizeTag()); } else { ShowPremiumPreviewBox(_controller, PremiumFeature::EmojiStatus);