fix login

This commit is contained in:
Laura Hausmann 2019-12-12 13:00:35 +01:00
parent f567aad5dd
commit c37b6091a7
Signed by: zotan
GPG key ID: 5EC1D38FFC321311
2 changed files with 7 additions and 2 deletions

View file

@ -121,7 +121,7 @@
<workItem from="1575536474314" duration="39215000" />
<workItem from="1575724030612" duration="6335000" />
<workItem from="1575806456895" duration="35215000" />
<workItem from="1576149306510" duration="923000" />
<workItem from="1576149306510" duration="1602000" />
</task>
<servers />
</component>

View file

@ -247,21 +247,24 @@ namespace telegram
}, ctsTyping.Token);
typingTask.Start();
break;
case Td.TdApi.Update.UpdateConnectionState state :
case Td.TdApi.Update.UpdateConnectionState state:
switch (state.State)
{
case Td.TdApi.ConnectionState.ConnectionStateConnecting _:
connectionState = "Connecting";
if (!authorized) return;
messageQueue.Add($"{Ansi.Yellow}[tgcli] Connecting to Telegram servers...");
ScreenUpdate();
break;
case Td.TdApi.ConnectionState.ConnectionStateConnectingToProxy _:
connectionState = "Connecting";
if (!authorized) return;
messageQueue.Add($"{Ansi.Yellow}[tgcli] Connecting to Proxy...");
ScreenUpdate();
break;
case Td.TdApi.ConnectionState.ConnectionStateReady _:
connectionState = "Ready";
if (!authorized) return;
messageQueue.Add($"{Ansi.Yellow}[tgcli] Connected.");
Task.Run(() =>
{
@ -272,11 +275,13 @@ namespace telegram
break;
case Td.TdApi.ConnectionState.ConnectionStateUpdating _:
connectionState = "Updating";
if (!authorized) return;
messageQueue.Add($"{Ansi.Yellow}[tgcli] Updating message cache...");
ScreenUpdate();
break;
case Td.TdApi.ConnectionState.ConnectionStateWaitingForNetwork _:
connectionState = "Waiting for Network";
if (!authorized) return;
messageQueue.Add($"{Ansi.Yellow}[tgcli] Lost connection. Waiting for network...");
ScreenUpdate();
break;