From f0c2f43aef2a45f7d90b97238fd8814bf332a226 Mon Sep 17 00:00:00 2001 From: Federico Armellini Date: Mon, 28 Jan 2019 22:16:58 +0100 Subject: [PATCH] . --- TLSharp.Core/TelegramClient.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index 2d1c71c..a7ab33a 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -93,13 +93,14 @@ namespace TLSharp.Core } } + TLExportedAuthorization exported = null; if (_session.TLUser != null) { TLRequestExportAuthorization exportAuthorization = new TLRequestExportAuthorization() { DcId = dcId }; exported = await SendRequestAsync(exportAuthorization, times); } - + _transport = new TcpTransport(dc.IpAddress, dc.Port, _handler); _session.ServerAddress = dc.IpAddress; @@ -107,13 +108,14 @@ namespace TLSharp.Core await ConnectAsync(true); + if (_session.TLUser != null) { TLRequestImportAuthorization importAuthorization = new TLRequestImportAuthorization() { Id = exported.Id, Bytes = exported.Bytes }; var imported = await SendRequestAsync(importAuthorization,times); OnUserAuthenticated(((TLUser)imported.User)); } - + } @@ -148,6 +150,10 @@ namespace TLSharp.Core { throw e; } + catch (Exception e) + { + Console.WriteLine(e.Message); + } } }