From a69db6ba27d66af25da2f977c9f7c2b3e876980e Mon Sep 17 00:00:00 2001 From: Paulo Rogerio Panhoto Date: Wed, 27 Dec 2017 17:32:27 -0200 Subject: [PATCH] TelegramClient exposes Session as a property so that TLUser can be retrieved by application in case the sign in process is bypassed. Example code: if (client.IsUserAuthorized()) user = client.Session.TLUser; else { /* sign in or sign up */ } --- TLSharp.Core/TelegramClient.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index ff9519e..eae8b59 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -30,6 +30,8 @@ namespace TLSharp.Core private List dcOptions; private TcpClientConnectionHandler _handler; + public Session Session { get { return _session; } } + public TelegramClient(int apiId, string apiHash, Session session = null, string sessionUserId = "session", TcpClientConnectionHandler handler = null) {