diff --git a/Telegram/SourceFiles/boxes/star_gift_box.cpp b/Telegram/SourceFiles/boxes/star_gift_box.cpp index 9bc0f064b..50011546d 100644 --- a/Telegram/SourceFiles/boxes/star_gift_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_box.cpp @@ -255,18 +255,26 @@ auto GenerateGiftMedia( replacing, sticker, st::giftBoxPreviewStickerPadding)); - const auto title = v::match(descriptor, [&](GiftTypePremium gift) { + auto title = v::match(descriptor, [&](GiftTypePremium gift) { return tr::lng_action_gift_premium_months( tr::now, lt_count, - gift.months); + gift.months, + Text::Bold); }, [&](const GiftTypeStars &gift) { return recipient->isSelf() - ? tr::lng_action_gift_self_subtitle(tr::now) + ? tr::lng_action_gift_self_subtitle(tr::now, Text::Bold) : tr::lng_action_gift_got_subtitle( tr::now, lt_user, - recipient->session().user()->shortName()); + TextWithEntities() + .append(Text::SingleCustomEmoji( + recipient->owner().customEmojiManager( + ).peerUserpicEmojiData( + recipient->session().user()))) + .append(' ') + .append(recipient->session().user()->shortName()), + Text::Bold); }); auto textFallback = v::match(descriptor, [&](GiftTypePremium gift) { return tr::lng_action_gift_premium_about( @@ -298,15 +306,20 @@ auto GenerateGiftMedia( auto description = data.text.empty() ? std::move(textFallback) : data.text; - pushText(Text::Bold(title), st::giftBoxPreviewTitlePadding); + const auto context = Core::MarkedTextContext{ + .session = &parent->history()->session(), + .customEmojiRepaint = [parent] { parent->repaint(); }, + }; + pushText( + std::move(title), + st::giftBoxPreviewTitlePadding, + {}, + context); pushText( std::move(description), st::giftBoxPreviewTextPadding, {}, - Core::MarkedTextContext{ - .session = &parent->history()->session(), - .customEmojiRepaint = [parent] { parent->repaint(); }, - }); + context); push(HistoryView::MakeGenericButtonPart( (data.upgraded diff --git a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp index e470b194c..700d6a123 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp @@ -72,6 +72,17 @@ TextWithEntities PremiumGift::title() { const auto peer = _parent->history()->peer; return peer->isSelf() ? tr::lng_action_gift_self_subtitle(tr::now, WithEntities) + : (peer->isServiceUser() && _data.channelFrom) + ? tr::lng_action_gift_got_subtitle( + tr::now, + lt_user, + WithEntities({}) + .append(SingleCustomEmoji( + peer->owner().customEmojiManager( + ).peerUserpicEmojiData(_data.channelFrom))) + .append(' ') + .append(_data.channelFrom->shortName()), + WithEntities) : peer->isServiceUser() ? tr::lng_gift_link_label_gift(tr::now, WithEntities) : (outgoingGift() @@ -79,7 +90,12 @@ TextWithEntities PremiumGift::title() { : tr::lng_action_gift_got_subtitle)( tr::now, lt_user, - WithEntities(peer->shortName()), + WithEntities({}) + .append(SingleCustomEmoji( + peer->owner().customEmojiManager( + ).peerUserpicEmojiData(peer))) + .append(' ') + .append(peer->shortName()), WithEntities); } else if (creditsPrize()) { return tr::lng_prize_title(tr::now, WithEntities);