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

Method noTelegramCodeDone

Telegram/SourceFiles/intro/intro_code.cpp:454–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454void CodeWidget::noTelegramCodeDone(const MTPauth_SentCode &result) {
455 _noTelegramCodeRequestId = 0;
456
457 result.match([&](const MTPDauth_sentCode &data) {
458 const auto &d = result.c_auth_sentCode();
459 fillSentCodeData(data);
460 _code->setDigitsCountMax(getData()->codeLength);
461 const auto next = data.vnext_type();
462 if (next && next->type() == mtpc_auth_codeTypeCall) {
463 getData()->callStatus = CallStatus::Waiting;
464 getData()->callTimeout = d.vtimeout().value_or(60);
465 } else {
466 getData()->callStatus = CallStatus::Disabled;
467 getData()->callTimeout = 0;
468 }
469 getData()->codeByTelegram = false;
470 updateDescText();
471 }, [&](const MTPDauth_sentCodeSuccess &data) {
472 finish(data.vauthorization());
473 }, [](const MTPDauth_sentCodePaymentRequired &) {
474 LOG(("API Error: Unexpected auth.sentCodePaymentRequired "
475 "(CodeWidget::noTelegramCodeDone)."));
476 });
477}
478
479void CodeWidget::noTelegramCodeFail(const MTP::Error &error) {
480 _noTelegramCodeRequestId = 0;

Callers

nothing calls this directly

Calls 4

setDigitsCountMaxMethod · 0.80
value_orMethod · 0.80
finishFunction · 0.50
typeMethod · 0.45

Tested by

no test coverage detected