2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added button for opening custom url to Ui::ConfirmPhoneBox.

This commit is contained in:
23rd
2022-12-29 00:33:01 +03:00
parent 44f79b8331
commit 613d4932ca
3 changed files with 39 additions and 5 deletions

View File

@@ -58,6 +58,10 @@ void ConfirmPhone::resolve(
}, [&](const MTPDauth_sentCodeTypeSetUpEmailRequired &) {
return bad("SetUpEmailRequired");
});
const auto fragmentUrl = data.vtype().match([](
const MTPDauth_sentCodeTypeFragmentSms &data) {
return qs(data.vurl());
}, [](const auto &) { return QString(); });
const auto phoneHash = qs(data.vphone_code_hash());
const auto timeout = [&]() -> std::optional<int> {
if (const auto nextType = data.vnext_type()) {
@@ -70,6 +74,7 @@ void ConfirmPhone::resolve(
auto box = Box<Ui::ConfirmPhoneBox>(
phone,
sentCodeLength,
fragmentUrl,
timeout);
const auto boxWeak = Ui::MakeWeak(box.data());
box->resendRequests(