aboutsummaryrefslogtreecommitdiff
path: root/telegram/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/handlers.go')
-rw-r--r--telegram/handlers.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go
index 8facc10..c7185f5 100644
--- a/telegram/handlers.go
+++ b/telegram/handlers.go
@@ -153,6 +153,13 @@ func (c *Client) updateHandler() {
// new user discovered
func (c *Client) updateUser(update *client.UpdateUser) {
+ // check if MUC nicknames should be updated
+ cacheUser, ok := c.cache.GetUser(update.User.Id)
+ if ok && (cacheUser.FirstName != update.User.FirstName || cacheUser.LastName != update.User.LastName) {
+ newNickname := c.GetMUCNickname(update.User.Id)
+ c.updateMUCsNickname(update.User.Id, newNickname)
+ }
+
c.cache.SetUser(update.User.Id, update.User)
show, status, presenceType := c.userStatusToText(update.User.Status, update.User.Id)
go c.ProcessStatusUpdate(update.User.Id, status, show, gateway.SPType(presenceType))