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 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{ contactInfo := map[string]any{
"com.beeper.bridge.identifiers": []string{ "com.beeper.bridge.identifiers": idents,
fmt.Sprintf("tel:%s", puppet.Phone), "com.beeper.bridge.remote_id": puppet.Key.String(),
fmt.Sprintf("gmsg-contact:%s", puppet.ContactID), "com.beeper.bridge.service": "gmessages",
}, "com.beeper.bridge.network": "gmessages",
"com.beeper.bridge.remote_id": puppet.Key.String(),
"com.beeper.bridge.service": "gmessages",
"com.beeper.bridge.network": "gmessages",
} }
err := puppet.DefaultIntent().BeeperUpdateProfile(ctx, contactInfo) err := puppet.DefaultIntent().BeeperUpdateProfile(ctx, contactInfo)
if err != nil { if err != nil {