Merge pull request #525 from mautrix/make-contact-agumentation-more-efficient

provisioning/list_contacts: make augmentation with avatar more efficient
This commit is contained in:
Sumner Evans 2022-07-01 13:21:07 -06:00 committed by GitHub
commit 7247e9b2e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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{}{