aboutsummaryrefslogtreecommitdiff
path: root/telegram/handlers.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-06-30 15:48:36 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-06-30 15:48:36 +0300
commitf8ad8c0204e2effabce4545c91992146a560168d (patch)
treed977e8738c3606af88fc3225b8db5abb49b34ac7 /telegram/handlers.go
parent739fc4110a9c12aa51cbd6361e5c4398c8ed7ff8 (diff)
Update chat title in chats cache
Diffstat (limited to 'telegram/handlers.go')
-rw-r--r--telegram/handlers.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go
index 57402ab..65e5f2f 100644
--- a/telegram/handlers.go
+++ b/telegram/handlers.go
@@ -294,8 +294,13 @@ func (c *Client) updateChatTitle(update *client.UpdateChatTitle) {
gateway.SetNickname(c.jid, strconv.FormatInt(update.ChatId, 10), update.Title, c.xmpp)
// set also the status (for group chats only)
- _, user, _ := c.GetContactByID(update.ChatId, nil)
+ chat, user, _ := c.GetContactByID(update.ChatId, nil)
if user == nil {
c.ProcessStatusUpdate(update.ChatId, update.Title, "chat", gateway.SPImmed(true))
}
+
+ // update chat title in the cache
+ if chat != nil {
+ chat.Title = update.Title
+ }
}