diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 62a50f27b..3bde59247 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2094,6 +2094,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_giveaway_results_credits#other" = "{count} winners of the giveaway were randomly selected by Telegram and received their prize."; "lng_action_giveaway_results_credits_some" = "Some winners of the giveaway were randomly selected by Telegram and received their prize."; "lng_action_giveaway_results_none" = "No winners of the giveaway could be selected."; +"lng_action_boost_apply_me" = "You boosted the group"; "lng_action_boost_apply#one" = "{from} boosted the group"; "lng_action_boost_apply#other" = "{from} boosted the group {count} times"; "lng_action_set_chat_intro" = "{from} added the message below for all empty chats. How?"; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 9a74ae332..48ed92995 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -5318,14 +5318,26 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { auto prepareBoostApply = [&](const MTPDmessageActionBoostApply &action) { auto result = PreparedServiceText(); const auto boosts = action.vboosts().v; + const auto isSelf = (_from->id == _from->session().userPeerId()); result.links.push_back(fromLink()); - result.text = tr::lng_action_boost_apply( - tr::now, - lt_count, - boosts, - lt_from, - fromLinkText(), // Link 1. - Ui::Text::WithEntities); + result.text = isSelf + ? tr::lng_action_boost_apply_me(tr::now, Ui::Text::WithEntities) + : tr::lng_action_boost_apply( + tr::now, + lt_count, + boosts, + lt_from, + fromLinkText(), // Link 1. + Ui::Text::WithEntities); + const auto channel = _history->peer->asChannel(); + setCustomServiceLink(std::make_shared([=]( + ClickContext context) { + const auto my = context.other.value(); + const auto weak = my.sessionWindow; + if (const auto strong = channel ? weak.get() : nullptr) { + strong->resolveBoostState(channel); + } + })); return result; }; auto preparePaymentRefunded = [&](const MTPDmessageActionPaymentRefunded &action) {