Make status updates asynchronous
This commit is contained in:
parent
7a2e355111
commit
915b7fe1de
|
@ -110,13 +110,13 @@ func (c *Client) updateHandler() {
|
||||||
func (c *Client) updateUser(update *client.UpdateUser) {
|
func (c *Client) updateUser(update *client.UpdateUser) {
|
||||||
c.cache.users[update.User.Id] = update.User
|
c.cache.users[update.User.Id] = update.User
|
||||||
show, status := c.userStatusToText(update.User.Status)
|
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
|
// user status changed
|
||||||
func (c *Client) updateUserStatus(update *client.UpdateUserStatus) {
|
func (c *Client) updateUserStatus(update *client.UpdateUserStatus) {
|
||||||
show, status := c.userStatusToText(update.Status)
|
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
|
// new chat discovered
|
||||||
|
@ -155,7 +155,7 @@ func (c *Client) updateNewChat(update *client.UpdateNewChat) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if update.Chat.Id < 0 {
|
if update.Chat.Id < 0 {
|
||||||
c.processStatusUpdate(update.Chat.Id, update.Chat.Title, "chat")
|
go c.processStatusUpdate(update.Chat.Id, update.Chat.Title, "chat")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue