Skip to content

Commit

Permalink
Re-set contact info if phone or contact ID changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Mar 1, 2024
1 parent 765dc61 commit 27d7edc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions puppet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27d7edc

Please sign in to comment.