Remove old test code giveaway creation.

This commit is contained in:
John Preston 2023-12-08 10:36:57 +04:00
parent 6471d43c71
commit f5b59c9456
1 changed files with 0 additions and 37 deletions

View File

@ -437,43 +437,6 @@ HistoryInner::HistoryInner(
_migrated->translateTo(_history->translatedTo());
}
#if 0
if (const auto channel = _history->peer->asBroadcast()) {
if (channel->amCreator()) {
const auto weak = base::make_weak(_controller);
channel->session().api().request(MTPpayments_GetPremiumGiftCodeOptions(
MTP_flags(MTPpayments_GetPremiumGiftCodeOptions::Flag::f_boost_peer),
channel->input
)).done(crl::guard(weak, [=](const MTPVector<MTPPremiumGiftCodeOption> &result) {
if (result.v.isEmpty()) {
return;
}
const auto &data = result.v.front().data();
const auto randomId = base::RandomValue<uint64>();
Payments::CheckoutProcess::Start(
Payments::InvoicePremiumGiftCode{
.purpose = Payments::InvoicePremiumGiftCodeGiveaway{
.boostPeer = channel,
//.additionalChannels = ,
.untilDate = (base::unixtime::now() + 300),
.onlyNewSubscribers = true,
},
.randomId = randomId,
.currency = qs(data.vcurrency()),
.amount = data.vamount().v,
.storeProduct = qs(data.vstore_product().value_or_empty()),
.storeQuantity = data.vstore_quantity().value_or_empty(),
.users = data.vusers().v,
.months = data.vmonths().v,
},
crl::guard(weak, [=](auto) { weak->window().activate(); }));
})).fail(crl::guard(weak, [=](const MTP::Error &error) {
weak.get()->showToast(error.type());
})).send();
}
}
#endif
Window::ChatThemeValueFromPeer(
controller,
_peer