diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index f1c8692..b1aafa1 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -300,41 +300,12 @@ namespace TLSharp.Core public async Task GetFile(TLAbsInputFileLocation location, int filePartSize, int offset = 0) { TLFile result = null; - try + result = await SendRequestAsync(new TLRequestGetFile() { - result = await SendRequestAsync(new TLRequestGetFile() - { - Location = location, - Limit = filePartSize, - Offset = offset - }); - } - catch (FileMigrationException ex) - { - var exportedAuth = await SendRequestAsync(new TLRequestExportAuthorization() { DcId = ex.DC }); - - var authKey = _session.AuthKey; - var timeOffset = _session.TimeOffset; - var serverAddress = _session.ServerAddress; - var serverPort = _session.Port; - - await ReconnectToDcAsync(ex.DC); - var auth = await SendRequestAsync(new TLRequestImportAuthorization - { - Bytes = exportedAuth.Bytes, - Id = exportedAuth.Id - }); - result = await GetFile(location, filePartSize, offset); - - _session.AuthKey = authKey; - _session.TimeOffset = timeOffset; - _transport = new TcpTransport(serverAddress, serverPort); - _session.ServerAddress = serverAddress; - _session.Port = serverPort; - await ConnectAsync(); - - } - + Location = location, + Limit = filePartSize, + Offset = offset + }); return result; }