aboutsummaryrefslogtreecommitdiff
path: root/telegram/connect.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/connect.go')
-rw-r--r--telegram/connect.go4
1 files changed, 4 insertions, 0 deletions
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