Reprioritise map creation

This commit is contained in:
Neil Alexander 2021-08-05 15:55:00 +01:00
parent 00dc43ce26
commit f4637932b6
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -473,6 +473,7 @@ func (a *KeyInternalAPI) QuerySignatures(ctx context.Context, req *api.QuerySign
} }
for sourceUserID, forSourceUser := range keyMap { for sourceUserID, forSourceUser := range keyMap {
for targetKeyID, targetSig := range forSourceUser {
if res.Signatures == nil { if res.Signatures == nil {
res.Signatures = map[string]map[gomatrixserverlib.KeyID]types.CrossSigningSigMap{} res.Signatures = map[string]map[gomatrixserverlib.KeyID]types.CrossSigningSigMap{}
} }
@ -485,7 +486,6 @@ func (a *KeyInternalAPI) QuerySignatures(ctx context.Context, req *api.QuerySign
if _, ok := res.Signatures[targetUserID][targetKeyID][sourceUserID]; !ok { if _, ok := res.Signatures[targetUserID][targetKeyID][sourceUserID]; !ok {
res.Signatures[targetUserID][targetKeyID][sourceUserID] = map[gomatrixserverlib.KeyID]gomatrixserverlib.Base64Bytes{} res.Signatures[targetUserID][targetKeyID][sourceUserID] = map[gomatrixserverlib.KeyID]gomatrixserverlib.Base64Bytes{}
} }
for targetKeyID, targetSig := range forSourceUser {
res.Signatures[targetUserID][targetKeyID][sourceUserID][targetKeyID] = targetSig res.Signatures[targetUserID][targetKeyID][sourceUserID][targetKeyID] = targetSig
} }
} }