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

Method reloadHelloStickers

Telegram/SourceFiles/api/api_premium.cpp:270–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270void Premium::reloadHelloStickers() {
271 if (_helloStickersRequestId) {
272 return;
273 }
274 _helloStickersRequestId = _api.request(MTPmessages_GetStickers(
275 MTP_string("\xf0\x9f\x91\x8b\xe2\xad\x90\xef\xb8\x8f"),
276 MTP_long(_helloStickersHash)
277 )).done([=](const MTPmessages_Stickers &result) {
278 _helloStickersRequestId = 0;
279 result.match([&](const MTPDmessages_stickersNotModified &) {
280 }, [&](const MTPDmessages_stickers &data) {
281 _helloStickersHash = data.vhash().v;
282 const auto owner = &_session->data();
283 _helloStickers.clear();
284 for (const auto &sticker : data.vstickers().v) {
285 const auto document = owner->processDocument(sticker);
286 if (document->sticker()) {
287 _helloStickers.push_back(document);
288 }
289 }
290 _helloStickersUpdated.fire({});
291 });
292 }).fail([=] {
293 _helloStickersRequestId = 0;
294 }).send();
295}
296
297void Premium::checkGiftCode(
298 const QString &slug,

Callers 1

helloStickersMethod · 0.80

Calls 11

MTP_stringFunction · 0.85
MTP_longFunction · 0.85
processDocumentMethod · 0.80
sendMethod · 0.45
failMethod · 0.45
doneMethod · 0.45
requestMethod · 0.45
dataMethod · 0.45
clearMethod · 0.45
stickerMethod · 0.45
fireMethod · 0.45

Tested by

no test coverage detected