From efbd3ca8fa5cbe0c3d5bed83520f8ad0f944e774 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 20 Sep 2024 12:03:44 +0400 Subject: [PATCH] Implement star gift view box. --- Telegram/Resources/langs/lang.strings | 7 + Telegram/SourceFiles/api/api_credits.cpp | 2 +- Telegram/SourceFiles/api/api_premium.cpp | 1 + Telegram/SourceFiles/api/api_premium.h | 1 + .../SourceFiles/boxes/gift_credits_box.cpp | 7 +- .../SourceFiles/boxes/gift_premium_box.cpp | 63 +++++++- Telegram/SourceFiles/boxes/gift_premium_box.h | 4 + Telegram/SourceFiles/data/data_credits.h | 9 +- Telegram/SourceFiles/data/data_media_types.h | 1 + Telegram/SourceFiles/history/history_item.cpp | 1 + .../view/media/history_view_premium_gift.cpp | 50 +++--- .../view/media/history_view_premium_gift.h | 1 + .../view/media/history_view_service_box.cpp | 24 +++ .../view/media/history_view_service_box.h | 3 + .../settings/settings_credits_graphics.cpp | 143 +++++++++++++++--- .../settings/settings_credits_graphics.h | 11 ++ 16 files changed, 279 insertions(+), 49 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index bb7afa3a7..ba82f1639 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3007,6 +3007,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_gift_sent_title" = "Gift Sent!"; "lng_gift_sent_about#one" = "You spent **{count}** Star from your balance."; "lng_gift_sent_about#other" = "You spent **{count}** Stars from your balance."; +"lng_gift_limited_of_one" = "unique"; +"lng_gift_limited_of_count" = "1 of {amount}"; +"lng_gift_anonymous_hint" = "Only you can see the sender's name."; +"lng_gift_availability" = "Availability"; +"lng_gift_availability_left#one" = "{count} of {amount} left"; +"lng_gift_availability_left#other" = "{count} of {amount} left"; +"lng_gift_availability_none" = "None of {amount} left"; "lng_accounts_limit_title" = "Limit Reached"; "lng_accounts_limit1#one" = "You have reached the limit of **{count}** connected account."; diff --git a/Telegram/SourceFiles/api/api_credits.cpp b/Telegram/SourceFiles/api/api_credits.cpp index f26a9380b..96ec1b15c 100644 --- a/Telegram/SourceFiles/api/api_credits.cpp +++ b/Telegram/SourceFiles/api/api_credits.cpp @@ -72,7 +72,7 @@ constexpr auto kTransactionsLimit = 100; return Data::CreditsHistoryEntry{ .id = qs(tl.data().vid()), .title = qs(tl.data().vtitle().value_or_empty()), - .description = qs(tl.data().vdescription().value_or_empty()), + .description = { qs(tl.data().vdescription().value_or_empty()) }, .date = base::unixtime::parse(tl.data().vdate().v), .photoId = photo ? photo->id : 0, .extended = std::move(extended), diff --git a/Telegram/SourceFiles/api/api_premium.cpp b/Telegram/SourceFiles/api/api_premium.cpp index 896fe7723..81b1d685b 100644 --- a/Telegram/SourceFiles/api/api_premium.cpp +++ b/Telegram/SourceFiles/api/api_premium.cpp @@ -612,6 +612,7 @@ auto PremiumGiftCodeOptions::requestStarGifts() gifts.push_back(StarGift{ .id = uint64(data.vid().v), .stars = int64(data.vstars().v), + .convertStars = int64(data.vconvert_stars().v), .document = document, .limitedLeft = remaining.value_or_empty(), .limitedCount = total.value_or_empty(), diff --git a/Telegram/SourceFiles/api/api_premium.h b/Telegram/SourceFiles/api/api_premium.h index 2d8f2417d..0399a04ca 100644 --- a/Telegram/SourceFiles/api/api_premium.h +++ b/Telegram/SourceFiles/api/api_premium.h @@ -76,6 +76,7 @@ struct GiftOptionData { struct StarGift { uint64 id = 0; int64 stars = 0; + int64 convertStars = 0; not_null document; int limitedLeft = 0; int limitedCount = 0; diff --git a/Telegram/SourceFiles/boxes/gift_credits_box.cpp b/Telegram/SourceFiles/boxes/gift_credits_box.cpp index 902b9cd21..976b2883a 100644 --- a/Telegram/SourceFiles/boxes/gift_credits_box.cpp +++ b/Telegram/SourceFiles/boxes/gift_credits_box.cpp @@ -100,6 +100,7 @@ struct PremiumGiftsDescriptor { struct GiftTypeStars { uint64 id = 0; int64 stars = 0; + int64 convertStars = 0; DocumentData *document = nullptr; bool limited = false; @@ -240,7 +241,7 @@ auto GenerateGiftMedia( auto textFallback = tr::lng_action_gift_got_stars_text( tr::now, lt_count, - v::get(descriptor).stars, + v::get(descriptor).convertStars, Ui::Text::RichLangValue); auto description = data.text.isEmpty() ? std::move(textFallback) @@ -519,6 +520,7 @@ void PreviewWrap::paintEvent(QPaintEvent *e) { list.push_back({ .id = gift.id, .stars = gift.stars, + .convertStars = gift.convertStars, .document = gift.document, .limited = (gift.limitedCount > 0), }); @@ -1428,8 +1430,7 @@ void GiftBox( const auto &stUser = st::premiumGiftsUserpicButton; const auto content = box->verticalLayout(); - AddSkip(content); - AddSkip(content); + AddSkip(content, st::defaultVerticalListSkip * 5); content->add( object_ptr>( diff --git a/Telegram/SourceFiles/boxes/gift_premium_box.cpp b/Telegram/SourceFiles/boxes/gift_premium_box.cpp index 37357dcb1..4873fcbcb 100644 --- a/Telegram/SourceFiles/boxes/gift_premium_box.cpp +++ b/Telegram/SourceFiles/boxes/gift_premium_box.cpp @@ -799,10 +799,12 @@ void AddTableRow( object_ptr value, style::margins valueMargins) { table->addRow( - object_ptr( - table, - std::move(label), - st::giveawayGiftCodeLabel), + (label + ? object_ptr( + table, + std::move(label), + st::giveawayGiftCodeLabel) + : object_ptr(nullptr)), std::move(value), st::giveawayGiftCodeLabelMargin, valueMargins); @@ -1708,6 +1710,59 @@ void ResolveGiveawayInfo( crl::guard(controller, show)); } +void AddStarGiftTable( + not_null controller, + not_null container, + const Data::CreditsHistoryEntry &entry) { + auto table = container->add( + object_ptr( + container, + st::giveawayGiftCodeTable), + st::giveawayGiftCodeTableMargin); + const auto peerId = PeerId(entry.barePeerId); + if (peerId) { + auto text = entry.in + ? tr::lng_credits_box_history_entry_peer_in() + : tr::lng_credits_box_history_entry_peer(); + AddTableRow(table, std::move(text), controller, peerId); + } + if (!entry.date.isNull()) { + AddTableRow( + table, + tr::lng_gift_link_label_date(), + rpl::single(Ui::Text::WithEntities(langDateTime(entry.date)))); + } + if (entry.limitedCount > 0) { + auto amount = rpl::single(TextWithEntities{ + QString::number(entry.limitedCount) + }); + AddTableRow( + table, + tr::lng_gift_availability(), + ((entry.limitedLeft > 0) + ? tr::lng_gift_availability_left( + lt_count, + rpl::single(entry.limitedLeft * 1.), + lt_amount, + std::move(amount), + Ui::Text::WithEntities) + : tr::lng_gift_availability_none( + lt_amount, + std::move(amount), + Ui::Text::WithEntities))); + } + if (!entry.description.empty()) { + table->addRow( + nullptr, + object_ptr( + table, + rpl::single(entry.description), + st::giveawayGiftCodeValue), + st::giveawayGiftCodeLabelMargin, + st::giveawayGiftCodeValueMargin); + } +} + void AddCreditsHistoryEntryTable( not_null controller, not_null container, diff --git a/Telegram/SourceFiles/boxes/gift_premium_box.h b/Telegram/SourceFiles/boxes/gift_premium_box.h index 43ca082b9..5d81cc063 100644 --- a/Telegram/SourceFiles/boxes/gift_premium_box.h +++ b/Telegram/SourceFiles/boxes/gift_premium_box.h @@ -76,6 +76,10 @@ void ResolveGiveawayInfo( std::optional start, std::optional results); +void AddStarGiftTable( + not_null controller, + not_null container, + const Data::CreditsHistoryEntry &entry); void AddCreditsHistoryEntryTable( not_null controller, not_null container, diff --git a/Telegram/SourceFiles/data/data_credits.h b/Telegram/SourceFiles/data/data_credits.h index 8882fc43c..af0f6e865 100644 --- a/Telegram/SourceFiles/data/data_credits.h +++ b/Telegram/SourceFiles/data/data_credits.h @@ -50,7 +50,7 @@ struct CreditsHistoryEntry final { QString id; QString title; - QString description; + TextWithEntities description; QDateTime date; PhotoId photoId = 0; std::vector extended; @@ -58,10 +58,17 @@ struct CreditsHistoryEntry final { uint64 bareMsgId = 0; uint64 barePeerId = 0; uint64 bareGiveawayMsgId = 0; + uint64 bareGiftStickerId = 0; PeerType peerType; QDateTime subscriptionUntil; QDateTime successDate; QString successLink; + int limitedCount = 0; + int limitedLeft = 0; + int convertStars = 0; + bool converted = false; + bool anonymous = false; + bool savedToProfile = false; bool reaction = false; bool refunded = false; bool pending = false; diff --git a/Telegram/SourceFiles/data/data_media_types.h b/Telegram/SourceFiles/data/data_media_types.h index 103840a64..c194429c1 100644 --- a/Telegram/SourceFiles/data/data_media_types.h +++ b/Telegram/SourceFiles/data/data_media_types.h @@ -141,6 +141,7 @@ struct GiftCode { MsgId giveawayMsgId = 0; int convertStars = 0; int limitedCount = 0; + int limitedLeft = 0; int count = 0; GiftType type = GiftType::Premium; bool viaGiveaway : 1 = false; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 5047d0b7d..cf2b78295 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -5490,6 +5490,7 @@ void HistoryItem::applyAction(const MTPMessageAction &action) { : TextWithEntities()), .convertStars = int(data.vconvert_stars().v), .limitedCount = gift.vavailability_total().value_or_empty(), + .limitedLeft = gift.vavailability_remains().value_or_empty(), .count = int(gift.vstars().v), .type = Data::GiftType::StarGift, .anonymous = data.is_name_hidden(), 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 ceba7d2e6..b45ea59f8 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp @@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_channel.h" #include "data/data_credits.h" #include "data/data_document.h" +#include "data/data_session.h" #include "data/data_user.h" #include "history/history.h" #include "history/history_item.h" @@ -79,14 +80,14 @@ TextWithEntities PremiumGift::subtitle() { ? tr::lng_action_gift_sent_text( tr::now, lt_count, - _data.count, + _data.convertStars, lt_user, Ui::Text::Bold(_parent->history()->peer->shortName()), Ui::Text::RichLangValue) : tr::lng_action_gift_got_stars_text( tr::now, lt_count, - _data.count, + _data.convertStars, Ui::Text::RichLangValue); } const auto isCreditsPrize = creditsPrize(); @@ -149,6 +150,7 @@ ClickHandlerPtr PremiumGift::createViewLink() { return nullptr; } const auto from = _gift->from(); + const auto itemId = _parent->data()->fullId(); const auto peer = _parent->history()->peer; const auto date = _parent->data()->date(); const auto data = _gift->data(); @@ -157,25 +159,21 @@ ClickHandlerPtr PremiumGift::createViewLink() { if (const auto controller = my.sessionWindow.get()) { const auto selfId = controller->session().userPeerId(); const auto sent = (from->id == selfId); - if (creditsPrize()) { - using Type = Data::CreditsHistoryEntry::PeerType; + if (starGift()) { + const auto item = controller->session().data().message(itemId); + if (item) { + controller->show(Box( + Settings::StarGiftViewBox, + controller, + data, + item)); + } + } else if (creditsPrize()) { controller->show(Box( - Settings::ReceiptCreditsBox, + Settings::CreditsPrizeBox, controller, - Data::CreditsHistoryEntry{ - .id = data.slug, - .title = QString(), - .description = QString(), - .date = base::unixtime::parse(date), - .credits = uint64(data.count), - .barePeerId = data.channel - ? data.channel->id.value - : 0, - .bareGiveawayMsgId = uint64(data.giveawayMsgId.bare), - .peerType = Type::Peer, - .in = true, - }, - Data::SubscriptionEntry())); + data, + date)); } else if (data.type == Data::GiftType::Credits) { const auto to = sent ? peer : peer->session().user(); controller->show(Box( @@ -212,6 +210,20 @@ void PremiumGift::draw( } } +QString PremiumGift::cornerTagText() { + if (const auto count = _data.limitedCount) { + return (count == 1) + ? tr::lng_gift_limited_of_one(tr::now) + : tr::lng_gift_limited_of_count( + tr::now, + lt_amount, + ((count % 1000) + ? Lang::FormatCountDecimal(count) + : Lang::FormatCountToShort(count).string)); + } + return QString(); +} + bool PremiumGift::hideServiceText() { return !gift(); } diff --git a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h index c62ee0a11..00883240d 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h @@ -29,6 +29,7 @@ public: QString title() override; TextWithEntities subtitle() override; rpl::producer button() override; + QString cornerTagText() override; int buttonSkip() override; void draw( Painter &p, diff --git a/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp b/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp index 571f13a09..08bd9408a 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp @@ -151,6 +151,30 @@ void ServiceBox::draw(Painter &p, const PaintContext &context) const { _content->draw(p, context, content); + if (const auto tag = _content->cornerTagText(); !tag.isEmpty()) { + const auto font = st::semiboldFont; + p.setFont(font); + p.setPen(Qt::NoPen); + const auto twidth = font->width(tag); + const auto pos = QPoint(_innerSize.width() - twidth, font->height); + const auto add = style::ConvertScale(2); + p.save(); + p.setClipRect( + -add, + -add, + _innerSize.width() + 2 * add, + _innerSize.height() + 2 * add); + p.translate(pos); + p.rotate(45.); + p.translate(-pos); + p.setPen(Qt::NoPen); + p.setBrush(context.st->msgServiceBg()); // ? + p.drawRect(-5 * twidth, 0, twidth * 12, font->height); + p.setPen(context.st->msgServiceFg()); + p.drawText(pos - QPoint(0, font->descent), tag); + p.restore(); + } + p.translate(0, -st::msgServiceGiftBoxTopSkip); } diff --git a/Telegram/SourceFiles/history/view/media/history_view_service_box.h b/Telegram/SourceFiles/history/view/media/history_view_service_box.h index d2d247eed..09ee92561 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_service_box.h +++ b/Telegram/SourceFiles/history/view/media/history_view_service_box.h @@ -28,6 +28,9 @@ public: return top(); } [[nodiscard]] virtual rpl::producer button() = 0; + [[nodiscard]] virtual QString cornerTagText() { + return {}; + } virtual void draw( Painter &p, const PaintContext &context, diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index eabd6d27b..3af7a925b 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -16,11 +16,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/gift_premium_box.h" #include "chat_helpers/stickers_gift_box_pack.h" #include "chat_helpers/stickers_lottie.h" +#include "core/application.h" #include "core/click_handler_types.h" #include "core/click_handler_types.h" // UrlClickHandler #include "core/ui_integration.h" #include "data/components/credits.h" #include "data/data_boosts.h" +#include "data/data_channel.h" #include "data/data_document.h" #include "data/data_document_media.h" #include "data/data_file_origin.h" @@ -35,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/channel_statistics/boosts/giveaway/boost_badge.h" // InfiniteRadialAnimationWidget. #include "info/settings/info_settings_widget.h" // SectionCustomTopBarData. #include "info/statistics/info_statistics_list_controllers.h" +#include "iv/iv_instance.h" #include "lang/lang_keys.h" #include "lottie/lottie_single_player.h" #include "main/main_app_config.h" @@ -657,6 +660,10 @@ void ReceiptCreditsBox( const auto &stUser = st::boostReplaceUserpic; const auto session = &controller->session(); const auto isPrize = e.bareGiveawayMsgId > 0; + const auto isStarGift = (e.convertStars > 0); + const auto starGiftSticker = (isStarGift && e.bareGiftStickerId) + ? session->data().document(e.bareGiftStickerId).get() + : nullptr; const auto peer = isPrize ? nullptr : (s.barePeerId) @@ -682,14 +689,15 @@ void ReceiptCreditsBox( std::unique_ptr lottie; rpl::lifetime downloadLifetime; }; - Ui::AddSkip( - content, - st::creditsHistoryEntryGiftStickerSpace); + Ui::AddSkip(content, st::creditsHistoryEntryGiftStickerSpace + - (isStarGift ? st::creditsHistoryEntryGiftStickerSkip : 0)); const auto icon = Ui::CreateChild(content); icon->resize(Size(st::creditsHistoryEntryGiftStickerSize)); const auto state = icon->lifetime().make_state(); auto &packs = session->giftBoxStickersPacks(); - const auto document = packs.lookup(packs.monthsForStars(e.credits)); + const auto document = starGiftSticker + ? starGiftSticker + : packs.lookup(packs.monthsForStars(e.credits)); if (document && document->sticker()) { state->sticker = document; state->media = document->createMediaView(); @@ -729,7 +737,7 @@ void ReceiptCreditsBox( ) | rpl::start_with_next([=](const QSize &size) { icon->move( (size.width() - icon->width()) / 2, - st::creditsHistoryEntryGiftStickerSkip); + isStarGift ? 0 : st::creditsHistoryEntryGiftStickerSkip); }, icon->lifetime()); } else { const auto widget = content->add( @@ -810,7 +818,11 @@ void ReceiptCreditsBox( context); } else { auto t = TextWithEntities() - .append(e.in ? u"+"_q : e.gift ? QString() : QString(kMinus)) + .append((e.in && !isStarGift) + ? u"+"_q + : e.gift + ? QString() + : QString(kMinus)) .append(Lang::FormatCountDecimal(std::abs(int64(e.credits)))) .append(QChar(' ')) .append(session->data().customEmojiManager().creditsEmoji()); @@ -882,7 +894,7 @@ void ReceiptCreditsBox( }, amount->lifetime()); } - if (!e.description.isEmpty()) { + if (!isStarGift && !e.description.empty()) { Ui::AddSkip(content); box->addRow(object_ptr>( box, @@ -891,7 +903,30 @@ void ReceiptCreditsBox( rpl::single(e.description), st::creditsBoxAbout))); } - if (e.gift || isPrize) { + if (isStarGift) { + Ui::AddSkip(content); + const auto about = box->addRow( + object_ptr>( + box, + object_ptr( + box, + rpl::combine( + tr::lng_action_gift_got_stars_text( + lt_count, + rpl::single(e.convertStars * 1.), + Ui::Text::RichLangValue), + tr::lng_paid_about_link() + ) | rpl::map([](TextWithEntities text, QString link) { + return text.append(' ').append(Ui::Text::Link(link)); + }), + st::creditsBoxAbout)))->entity(); + about->setClickHandlerFilter([=](const auto &...) { + Core::App().iv().openWithIvPreferred( + session, + tr::lng_paid_about_link_url(tr::now)); + return false; + }); + } else if (e.gift || isPrize) { Ui::AddSkip(content); const auto arrow = Ui::Text::SingleCustomEmoji( session->data().customEmojiManager().registerInternalEmoji( @@ -929,23 +964,35 @@ void ReceiptCreditsBox( Ui::AddSkip(content); Ui::AddSkip(content); - AddCreditsHistoryEntryTable(controller, content, e); - AddSubscriptionEntryTable(controller, content, s); + if (isStarGift) { + AddStarGiftTable(controller, content, e); + } else { + AddCreditsHistoryEntryTable(controller, content, e); + AddSubscriptionEntryTable(controller, content, s); + } Ui::AddSkip(content); - box->addRow(object_ptr>( - box, - object_ptr( + if (!isStarGift) { + box->addRow(object_ptr>( box, - tr::lng_credits_box_out_about( - lt_link, - tr::lng_payments_terms_link( - ) | Ui::Text::ToLink( - tr::lng_credits_box_out_about_link(tr::now)), - Ui::Text::WithEntities), - st::creditsBoxAboutDivider))); - + object_ptr( + box, + tr::lng_credits_box_out_about( + lt_link, + tr::lng_payments_terms_link( + ) | Ui::Text::ToLink( + tr::lng_credits_box_out_about_link(tr::now)), + Ui::Text::WithEntities), + st::creditsBoxAboutDivider))); + } else if (e.anonymous) { + box->addRow(object_ptr>( + box, + object_ptr( + box, + tr::lng_gift_anonymous_hint(), + st::creditsBoxAboutDivider))); + } if (s) { Ui::AddSkip(content); box->addRow(object_ptr>( @@ -1085,6 +1132,60 @@ void GiftedCreditsBox( }, {}); } +void CreditsPrizeBox( + not_null box, + not_null controller, + const Data::GiftCode &data, + TimeId date) { + using Type = Data::CreditsHistoryEntry::PeerType; + Settings::ReceiptCreditsBox( + box, + controller, + Data::CreditsHistoryEntry{ + .id = data.slug, + .title = QString(), + .description = QString(), + .date = base::unixtime::parse(date), + .credits = uint64(data.count), + .barePeerId = data.channel + ? data.channel->id.value + : 0, + .bareGiveawayMsgId = uint64(data.giveawayMsgId.bare), + .peerType = Type::Peer, + .in = true, + }, + Data::SubscriptionEntry()); +} + +void StarGiftViewBox( + not_null box, + not_null controller, + const Data::GiftCode &data, + not_null item) { + Settings::ReceiptCreditsBox( + box, + controller, + Data::CreditsHistoryEntry{ + .id = data.slug, + .description = data.message, + .date = base::unixtime::parse(item->date()), + .credits = uint64(data.count), + .bareMsgId = uint64(item->id.bare), + .barePeerId = item->history()->peer->id.value, + .bareGiftStickerId = data.document ? data.document->id : 0, + .peerType = Data::CreditsHistoryEntry::PeerType::Peer, + .limitedCount = data.limitedCount, + .limitedLeft = data.limitedLeft, + .convertStars = data.convertStars, + .converted = data.converted, + .anonymous = data.anonymous, + .savedToProfile = data.saved, + .in = true, + .gift = true, + }, + Data::SubscriptionEntry()); +} + void ShowRefundInfoBox( not_null controller, FullMsgId refundItemId) { diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.h b/Telegram/SourceFiles/settings/settings_credits_graphics.h index c57f0490a..aca4691cb 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.h +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.h @@ -16,6 +16,7 @@ namespace Data { struct Boost; struct CreditsHistoryEntry; struct SubscriptionEntry; +struct GiftCode; } // namespace Data namespace Main { @@ -86,6 +87,16 @@ void GiftedCreditsBox( not_null to, int count, TimeId date); +void CreditsPrizeBox( + not_null box, + not_null controller, + const Data::GiftCode &data, + TimeId date); +void StarGiftViewBox( + not_null box, + not_null controller, + const Data::GiftCode &data, + not_null item); void ShowRefundInfoBox( not_null controller, FullMsgId refundItemId);