diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index df5a3d6c02..99568c16bf 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1891,6 +1891,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_action_story_mention_unavailable" = "The story where {user} mentioned you is no longer available."; "lng_action_giveaway_started_group" = "{from} just started a giveaway of Telegram Premium subscriptions to its members."; "lng_action_giveaway_started" = "{from} just started a giveaway of Telegram Premium subscriptions to its followers."; +"lng_action_giveaway_credits_started_amount#one" = "{count} Star"; +"lng_action_giveaway_credits_started_amount#other" = "{count} Stars"; +"lng_action_giveaway_credits_started_group" = "{from} just started a giveaway of {amount} to its members."; +"lng_action_giveaway_credits_started" = "{from} just started a giveaway of {amount} to its followers."; "lng_action_giveaway_results#one" = "{count} winner of the giveaway was randomly selected by Telegram and received private messages with giftcodes."; "lng_action_giveaway_results#other" = "{count} winners of the giveaway were randomly selected by Telegram and received private messages with giftcodes."; "lng_action_giveaway_results_some" = "Some winners of the giveaway were randomly selected by Telegram and received private messages with giftcodes."; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 5e4e6021f7..edc2da6349 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -5149,15 +5149,30 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) { }; auto prepareGiveawayLaunch = [&](const MTPDmessageActionGiveawayLaunch &action) { + const auto credits = action.vstars().value_or_empty(); auto result = PreparedServiceText(); result.links.push_back(fromLink()); - result.text = (_history->peer->isMegagroup() - ? tr::lng_action_giveaway_started_group - : tr::lng_action_giveaway_started)( - tr::now, - lt_from, - fromLinkText(), // Link 1. - Ui::Text::WithEntities); + result.text = credits + ? (_history->peer->isMegagroup() + ? tr::lng_action_giveaway_credits_started_group + : tr::lng_action_giveaway_credits_started)( + tr::now, + lt_from, + fromLinkText(), // Link 1. + lt_amount, + tr::lng_action_giveaway_credits_started_amount( + tr::now, + lt_count_decimal, + float64(credits), + Ui::Text::Bold), + Ui::Text::WithEntities) + : (_history->peer->isMegagroup() + ? tr::lng_action_giveaway_started_group + : tr::lng_action_giveaway_started)( + tr::now, + lt_from, + fromLinkText(), // Link 1. + Ui::Text::WithEntities); return result; };