Re-set contact info if phone or contact ID changes

This commit is contained in:
Tulir Asokan 2024-03-01 14:44:29 +02:00
parent 765dc618e6
commit 27d7edcb6d

View file

@ -313,10 +313,12 @@ func (puppet *Puppet) Sync(ctx context.Context, source *User, contact *gmproto.P
update := false
if contact.ID.Number != "" && puppet.Phone != contact.ID.Number {
puppet.Phone = contact.ID.Number
puppet.ContactInfoSet = false
update = true
}
if contact.ContactID != puppet.ContactID {
puppet.ContactID = contact.ContactID
puppet.ContactInfoSet = false
update = true
}
update = puppet.UpdateName(ctx, contact.GetFormattedNumber(), contact.GetFullName(), contact.GetFirstName()) || update