Don't set blank gmsg-contact URI in ghost identifiers

This commit is contained in:
Tulir Asokan 2024-02-29 15:50:19 +02:00
parent 4998d4a34b
commit c409f75797

View file

@ -289,14 +289,18 @@ func (puppet *Puppet) UpdateContactInfo(ctx context.Context) bool {
return false
}
idents := []string{
fmt.Sprintf("tel:%s", puppet.Phone),
}
if puppet.ContactID != "" {
idents = append(idents, fmt.Sprintf("gmsg-contact:%s", puppet.ContactID))
}
contactInfo := map[string]any{
"com.beeper.bridge.identifiers": []string{
fmt.Sprintf("tel:%s", puppet.Phone),
fmt.Sprintf("gmsg-contact:%s", puppet.ContactID),
},
"com.beeper.bridge.remote_id": puppet.Key.String(),
"com.beeper.bridge.service": "gmessages",
"com.beeper.bridge.network": "gmessages",
"com.beeper.bridge.identifiers": idents,
"com.beeper.bridge.remote_id": puppet.Key.String(),
"com.beeper.bridge.service": "gmessages",
"com.beeper.bridge.network": "gmessages",
}
err := puppet.DefaultIntent().BeeperUpdateProfile(ctx, contactInfo)
if err != nil {