MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / GiftUpgrade

Function GiftUpgrade

Telegram/SourceFiles/boxes/star_gift_box.cpp:1400–1422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1398}
1399
1400void GiftUpgrade(
1401 not_null<Window::SessionController*> window,
1402 not_null<PeerData*> peer,
1403 QString giftPrepayUpgradeHash,
1404 int stars,
1405 Fn<void(bool)> done) {
1406 const auto weak = base::make_weak(window);
1407 auto formDone = [=](
1408 Payments::CheckoutResult result,
1409 const MTPUpdates *updates) {
1410 const auto success = (result == Payments::CheckoutResult::Paid);
1411 if (success) {
1412 ShowUpgradeGiftedToast(weak, peer);
1413 }
1414 done(success);
1415 };
1416 RequestStarsFormAndSubmit(
1417 window->uiShow(),
1418 MTP_inputInvoiceStarGiftPrepaidUpgrade(
1419 peer->input(),
1420 MTP_string(giftPrepayUpgradeHash)),
1421 std::move(formDone));
1422}
1423
1424void SoldOutBox(
1425 not_null<GenericBox*> box,

Callers 1

UpgradeBoxFunction · 0.85

Calls 5

ShowUpgradeGiftedToastFunction · 0.85
MTP_stringFunction · 0.85
uiShowMethod · 0.45
inputMethod · 0.45

Tested by

no test coverage detected