diff options
Diffstat (limited to 'telegram/commands.go')
-rw-r--r-- | telegram/commands.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/telegram/commands.go b/telegram/commands.go index b4920d4..b729973 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -244,6 +244,9 @@ 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 { @@ -324,10 +327,13 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string lastname = rawCmdArguments(cmdline, 1) } + c.locks.authorizerWriteLock.Lock() if c.authorizer != nil && !c.authorizer.isClosed { c.authorizer.FirstName <- firstname c.authorizer.LastName <- lastname + c.locks.authorizerWriteLock.Unlock() } else { + c.locks.authorizerWriteLock.Unlock() if !c.Online() { return notOnline } |