| 452 | } |
| 453 | |
| 454 | void 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 | |
| 479 | void CodeWidget::noTelegramCodeFail(const MTP::Error &error) { |
| 480 | _noTelegramCodeRequestId = 0; |
nothing calls this directly
no test coverage detected