diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-21 05:16:43 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-12-21 05:16:43 +0300 |
commit | 915b7fe1de6bf8f726a596b000956ae14ecbf2a2 (patch) | |
tree | d70990b48e10b432f02564ecbbff5134dec36d8b | |
parent | 7a2e355111d7e431baaf3a2001eb20afdf0f5fe1 (diff) |
Make status updates asynchronous
-rw-r--r-- | telegram/handlers.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go index d6b945f..aea1844 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -110,13 +110,13 @@ func (c *Client) updateHandler() { func (c *Client) updateUser(update *client.UpdateUser) { c.cache.users[update.User.Id] = update.User show, status := c.userStatusToText(update.User.Status) - c.processStatusUpdate(int64(update.User.Id), status, show) + go c.processStatusUpdate(int64(update.User.Id), status, show) } // user status changed func (c *Client) updateUserStatus(update *client.UpdateUserStatus) { show, status := c.userStatusToText(update.Status) - c.processStatusUpdate(int64(update.UserId), status, show, gateway.SPImmed(false)) + go c.processStatusUpdate(int64(update.UserId), status, show, gateway.SPImmed(false)) } // new chat discovered @@ -155,7 +155,7 @@ func (c *Client) updateNewChat(update *client.UpdateNewChat) { } if update.Chat.Id < 0 { - c.processStatusUpdate(update.Chat.Id, update.Chat.Title, "chat") + go c.processStatusUpdate(update.Chat.Id, update.Chat.Title, "chat") } } |