From 7c11fd58cf55fda32d43747b2aed999d28567e13 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 5 Apr 2023 17:39:01 +0400 Subject: [PATCH] Make whole same-background message clickable. --- Telegram/Resources/langs/lang.strings | 5 ++--- Telegram/SourceFiles/history/history_item.cpp | 7 ------- .../history/view/history_view_service_message.cpp | 2 ++ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 98ac1a7cc3..e2d353ad44 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1523,9 +1523,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_attach_menu_bot_allowed" = "You allowed this bot to message you when you added it in the attachment menu."; "lng_action_set_wallpaper_me" = "You set a new background for this chat."; "lng_action_set_wallpaper" = "{user} set a new background for this chat."; -"lng_action_set_same_wallpaper_me" = "You set {background} for this chat."; -"lng_action_set_same_wallpaper" = "{user} set {background} for this chat."; -"lng_action_set_same_background" = "the same background"; +"lng_action_set_same_wallpaper_me" = "You set the same background for this chat."; +"lng_action_set_same_wallpaper" = "{user} set the same background for this chat."; "lng_action_topic_created_inside" = "Topic created"; "lng_action_topic_closed_inside" = "Topic closed"; "lng_action_topic_reopened_inside" = "Topic reopened"; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 2ab72b0194..0321c99a9b 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -4193,21 +4193,14 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { if (!isSelf) { result.links.push_back(peer->createOpenLink()); } - if (const auto dependent = GetServiceDependentData()) { - result.links.push_back(dependent->lnk); - } result.text = isSelf ? tr::lng_action_set_same_wallpaper( tr::now, lt_user, Ui::Text::Link(name, 1), // Link 1. - lt_background, - Ui::Text::Link(tr::lng_action_set_same_background(tr::now), 2), Ui::Text::WithEntities) : tr::lng_action_set_same_wallpaper_me( tr::now, - lt_background, - Ui::Text::Link(tr::lng_action_set_same_background(tr::now), 1), Ui::Text::WithEntities); return result; }; diff --git a/Telegram/SourceFiles/history/view/history_view_service_message.cpp b/Telegram/SourceFiles/history/view/history_view_service_message.cpp index 2697ad7c4b..0c45ddaf8d 100644 --- a/Telegram/SourceFiles/history/view/history_view_service_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_service_message.cpp @@ -652,6 +652,8 @@ TextState Service::textState(QPoint point, StateRequest request) const { if (TTLMenu::TTLValidator(nullptr, history()->peer).can()) { result.link = ttl->link; } + } else if (const auto same = item->Get()) { + result.link = same->lnk; } } } else if (media) {