From 7a2e355111d7e431baaf3a2001eb20afdf0f5fe1 Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Sat, 21 Dec 2019 02:04:47 +0200 Subject: [PATCH] Add comments for auth stages --- telegram/connect.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telegram/connect.go b/telegram/connect.go index 3a5a91f..cb9936a 100644 --- a/telegram/connect.go +++ b/telegram/connect.go @@ -164,6 +164,7 @@ func (c *Client) interactor() { log.Debugf("%#v", state) switch stateType { + // stage 0: set login case client.TypeAuthorizationStateWaitPhoneNumber: log.Warn("Logging in...") if c.Session.Login != "" { @@ -171,12 +172,15 @@ func (c *Client) interactor() { } else { gateway.SendMessage(c.jid, "", "Please, enter your Telegram login via /login 12345", c.xmpp) } + // stage 1: wait for auth code case client.TypeAuthorizationStateWaitCode: log.Warn("Waiting for authorization code...") gateway.SendMessage(c.jid, "", "Please, enter authorization code via /code 12345", c.xmpp) + // stage 2: wait for 2fa case client.TypeAuthorizationStateWaitPassword: log.Warn("Waiting for 2FA password...") gateway.SendMessage(c.jid, "", "Please, enter 2FA passphrase via /password 12345", c.xmpp) + // stage 3: auth completed case client.TypeAuthorizationStateReady: var err error