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="1575536474314" duration="39215000" />
<workItem from="1575724030612" duration="6335000" /> <workItem from="1575724030612" duration="6335000" />
<workItem from="1575806456895" duration="35215000" /> <workItem from="1575806456895" duration="35215000" />
<workItem from="1576149306510" duration="923000" /> <workItem from="1576149306510" duration="1602000" />
</task> </task>
<servers /> <servers />
</component> </component>

View file

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