aboutsummaryrefslogtreecommitdiff
path: root/telegram/commands.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-09-01 01:24:30 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-09-01 01:24:30 +0300
commit282a6fc21b9626ab1bdc9c5a78162d90b7d28aa2 (patch)
tree10dd90f60829e42b1002f1f3997ed091c8a14dd9 /telegram/commands.go
parent4588170d1e43db780c551177f5996598fe25bc6e (diff)
Hotfix: prevent lockup on loginv1.8.2
Diffstat (limited to 'telegram/commands.go')
-rw-r--r--telegram/commands.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/telegram/commands.go b/telegram/commands.go
index b729973..87fff72 100644
--- a/telegram/commands.go
+++ b/telegram/commands.go
@@ -244,17 +244,20 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string
return notEnoughArguments
}
- c.locks.authorizerWriteLock.Lock()
- defer c.locks.authorizerWriteLock.Unlock()
-
if cmd == "login" {
err := c.TryLogin(resource, args[0])
if err != nil {
return err.Error()
}
+ c.locks.authorizerWriteLock.Lock()
+ defer c.locks.authorizerWriteLock.Unlock()
+
c.authorizer.PhoneNumber <- args[0]
} else {
+ c.locks.authorizerWriteLock.Lock()
+ defer c.locks.authorizerWriteLock.Unlock()
+
if c.authorizer == nil {
return TelegramNotInitialized
}