diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-05 13:21:56 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-05 13:21:56 +0300 |
commit | 4b2969925bfee6c54afa1b8097177e8b931b8106 (patch) | |
tree | 77323774d47dc78e8ff4fa538a6a24194616c19d /telegram/utils.go | |
parent | 39d38fb487c0e09be63a5c50e3cb13211fe7b12c (diff) |
Fix status caching and send status on subscription
Diffstat (limited to 'telegram/utils.go')
-rw-r--r-- | telegram/utils.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index 87176fc..6d668b3 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -194,8 +194,11 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, a } } + cachedStatus, ok := c.cache.GetStatus(chatID) if status == "" { - if user != nil { + if ok { + show, status = cachedStatus.XMPP, cachedStatus.Description + } else if user != nil && user.Status != nil { show, status = c.userStatusToText(user.Status, chatID) } else { show, status = "chat", chat.Title |