From 5e68dace9fd31160520d3238beb627fbabfbba22 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 22 Mar 2024 11:59:48 +0400 Subject: [PATCH] Remove description in intro settings preview. --- .../SourceFiles/history/view/history_view_about_view.cpp | 9 ++++++--- .../SourceFiles/history/view/history_view_about_view.h | 2 +- .../settings/business/settings_chat_intro.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_about_view.cpp b/Telegram/SourceFiles/history/view/history_view_about_view.cpp index 18c6921184..a748f962dc 100644 --- a/Telegram/SourceFiles/history/view/history_view_about_view.cpp +++ b/Telegram/SourceFiles/history/view/history_view_about_view.cpp @@ -270,9 +270,12 @@ void AboutView::makeIntro(not_null user) { make(user->businessDetails().intro); } -void AboutView::make(Data::ChatIntro data) { +void AboutView::make(Data::ChatIntro data, bool preview) { const auto text = data - ? tr::lng_action_set_chat_intro(tr::now, lt_from, _history->peer->name()) + ? tr::lng_action_set_chat_intro( + tr::now, + lt_from, + _history->peer->name()) : QString(); const auto item = _history->makeMessage({ .id = _history->nextNonHistoryEntryId(), @@ -311,7 +314,7 @@ void AboutView::make(Data::ChatIntro data) { .maxWidth = st::chatIntroWidth, .serviceLink = std::make_shared(handler), .service = true, - .hideServiceText = text.isEmpty(), + .hideServiceText = preview || text.isEmpty(), })); if (!data.sticker && _helloChosen) { data.sticker = _helloChosen; diff --git a/Telegram/SourceFiles/history/view/history_view_about_view.h b/Telegram/SourceFiles/history/view/history_view_about_view.h index 681b93e7fe..c922157c92 100644 --- a/Telegram/SourceFiles/history/view/history_view_about_view.h +++ b/Telegram/SourceFiles/history/view/history_view_about_view.h @@ -28,7 +28,7 @@ public: bool refresh(); - void make(Data::ChatIntro data); + void make(Data::ChatIntro data, bool preview = false); int top = 0; int height = 0; diff --git a/Telegram/SourceFiles/settings/business/settings_chat_intro.cpp b/Telegram/SourceFiles/settings/business/settings_chat_intro.cpp index 175538428e..2d71d2a607 100644 --- a/Telegram/SourceFiles/settings/business/settings_chat_intro.cpp +++ b/Telegram/SourceFiles/settings/business/settings_chat_intro.cpp @@ -384,7 +384,7 @@ void PreviewWrap::prepare(rpl::producer value) { _delegate.get()); std::move(value) | rpl::start_with_next([=](Data::ChatIntro intro) { - _view->make(std::move(intro)); + _view->make(std::move(intro), true); if (width() >= st::msgMinWidth) { resizeTo(width()); }