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

Method giftCodeValue

Telegram/SourceFiles/api/api_premium.cpp:334–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334rpl::producer<GiftCode> Premium::giftCodeValue(const QString &slug) const {
335 return _giftCodeUpdated.events_starting_with_copy(
336 slug
337 ) | rpl::filter(rpl::mappers::_1 == slug) | rpl::map([=] {
338 const auto i = _giftCodes.find(slug);
339 return (i != end(_giftCodes)) ? i->second : GiftCode();
340 });
341}
342
343void Premium::applyGiftCode(const QString &slug, Fn<void(QString)> done) {
344 _api.request(MTPpayments_ApplyGiftCode(

Callers 1

GiftCodeBoxFunction · 0.80

Calls 2

GiftCodeClass · 0.70
findMethod · 0.45

Tested by

no test coverage detected