From b5d7ef311de4dbc618395628301aee31c01dd8a8 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:29:02 +0100 Subject: [PATCH] Small change to support Firebase SMS --- src/Client.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client.cs b/src/Client.cs index 452a82d..a9db6c5 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -1074,9 +1074,12 @@ namespace WTelegram else if (sentCodeBase is Auth_SentCode sentCode) { phone_code_hash = sentCode.phone_code_hash; + var timeout = DateTime.UtcNow + TimeSpan.FromSeconds(sentCode.timeout); + Helpers.Log(3, $"A verification code has been sent via {sentCode.type.GetType().Name[17..]}"); + RaiseUpdate(sentCode); if (sentCode.type is Auth_SentCodeTypeFirebaseSms firebaseSms) { - var token = await ConfigAsync("firebase:" + Convert.ToHexString(firebaseSms.nonce)); + var token = await ConfigAsync("firebase"); int index = token?.IndexOf(':') ?? -1; if (!(index > 0 && token[..index] switch { @@ -1089,9 +1092,6 @@ namespace WTelegram goto resent; } } - var timeout = DateTime.UtcNow + TimeSpan.FromSeconds(sentCode.timeout); - Helpers.Log(3, $"A verification code has been sent via {sentCode.type.GetType().Name[17..]}"); - RaiseUpdate(sentCode); for (int retry = 1; authorization == null; retry++) try {