| 332 | } |
| 333 | |
| 334 | rpl::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 | |
| 343 | void Premium::applyGiftCode(const QString &slug, Fn<void(QString)> done) { |
| 344 | _api.request(MTPpayments_ApplyGiftCode( |
no test coverage detected