From bf568d80cc05b69b30532dd650974d2bbb80a684 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Thu, 1 Mar 2018 23:41:35 +0800 Subject: [PATCH] TelegramClient: change Connect() to return void instead of always true If a method that returns bool is never returning false, it's essentially not giving any information at all, which means that it should return void. This will help the consumers of this API to stop thinking that the result of this function means if the connection was succesful (which it is, actually, but it was never returning false because if there's any problem connecting, the result would be an exception instead). --- TLSharp.Core/TelegramClient.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index 0a7b070..45d15af 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -50,7 +50,7 @@ namespace TLSharp.Core _transport = new TcpTransport(_session.ServerAddress, _session.Port, _handler); } - public async Task ConnectAsync(bool reconnect = false) + public async Task ConnectAsync(bool reconnect = false) { if (_session.AuthKey == null || reconnect) { @@ -77,8 +77,6 @@ namespace TLSharp.Core await _sender.Receive(invokewithLayer); dcOptions = ((TLConfig)invokewithLayer.Response).DcOptions.ToList(); - - return true; } private async Task ReconnectToDcAsync(int dcId)