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

Method applyGiftCode

Telegram/SourceFiles/api/api_premium.cpp:343–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343void Premium::applyGiftCode(const QString &slug, Fn<void(QString)> done) {
344 _api.request(MTPpayments_ApplyGiftCode(
345 MTP_string(slug)
346 )).done([=](const MTPUpdates &result) {
347 _session->api().applyUpdates(result);
348 done({});
349 }).fail([=](const MTP::Error &error) {
350 done(error.type());
351 }).send();
352}
353
354void Premium::resolveGiveawayInfo(
355 not_null<PeerData*> peer,

Callers 1

GiftCodeBoxFunction · 0.80

Calls 8

MTP_stringFunction · 0.85
apiMethod · 0.80
sendMethod · 0.45
failMethod · 0.45
doneMethod · 0.45
requestMethod · 0.45
applyUpdatesMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected