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); + } } }