Don't skip devices that don't have signatures

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

View file

@ -66,14 +66,8 @@ func GetUserDevices(
Keys: key, Keys: key,
} }
targetUser, ok := sigRes.Signatures[dev.UserID] if targetUser, ok := sigRes.Signatures[dev.UserID]; ok {
if !ok { if targetKey, ok := targetUser[gomatrixserverlib.KeyID(dev.DeviceID)]; !ok {
continue
}
targetKey, ok := targetUser[gomatrixserverlib.KeyID(dev.DeviceID)]
if !ok {
continue
}
for sourceUserID, forSourceUser := range targetKey { for sourceUserID, forSourceUser := range targetKey {
for sourceKeyID, sourceKey := range forSourceUser { for sourceKeyID, sourceKey := range forSourceUser {
if _, ok := device.Keys.Signatures[sourceUserID]; !ok { if _, ok := device.Keys.Signatures[sourceUserID]; !ok {
@ -82,6 +76,8 @@ func GetUserDevices(
device.Keys.Signatures[sourceUserID][sourceKeyID] = sourceKey device.Keys.Signatures[sourceUserID][sourceKeyID] = sourceKey
} }
} }
}
}
response.Devices = append(response.Devices, device) response.Devices = append(response.Devices, device)
} }