client: Prefer contact name if exists

Don't allow TG user to override your own contact name for them after
they have been made a contact.
This commit is contained in:
Toni Spets
2025-05-30 13:11:16 +03:00
parent a9a267bc0d
commit 3c3c3f1dec
3 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -691,9 +691,10 @@ func (t *TelegramClient) getUserInfoFromTelegramUser(ctx context.Context, u tg.U
ExtraUpdates: func(ctx context.Context, ghost *bridgev2.Ghost) (changed bool) {
meta := ghost.Metadata.(*GhostMetadata)
if !user.Min {
changed = changed || meta.IsPremium != user.Premium || meta.IsBot != user.Bot
changed = changed || meta.IsPremium != user.Premium || meta.IsBot != user.Bot || meta.IsContact != user.Contact
meta.IsPremium = user.Premium
meta.IsBot = user.Bot
meta.IsContact = user.Contact
meta.Deleted = user.Deleted
}
return changed