| 1398 | } |
| 1399 | |
| 1400 | void 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 | |
| 1424 | void SoldOutBox( |
| 1425 | not_null<GenericBox*> box, |
no test coverage detected