provisioning/list_contacts: make augmentation with avatar more efficient

Signed-off-by: Sumner Evans <sumner@beeper.com>
This commit is contained in:
Sumner Evans 2022-07-01 13:15:08 -06:00
parent 1e8fb6459d
commit 07a43e6541
No known key found for this signature in database
GPG key ID: 8904527AB50022FD

View file

@ -294,7 +294,7 @@ func (prov *ProvisioningAPI) ListContacts(w http.ResponseWriter, r *http.Request
augmentedContacts := map[types.JID]interface{}{}
for jid, contact := range contacts {
var avatarUrl id.ContentURI
if puppet := prov.bridge.DB.Puppet.Get(jid); puppet != nil {
if puppet := prov.bridge.GetPuppetByJID(jid); puppet != nil {
avatarUrl = puppet.AvatarURL
}
augmentedContacts[jid] = map[string]interface{}{