aboutsummaryrefslogtreecommitdiff
path: root/keyserver/internal
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-07-31 14:40:45 +0100
committerGitHub <noreply@github.com>2020-07-31 14:40:45 +0100
commitb5cb1d153458ad83abdfbebed7405dd9da159cb8 (patch)
tree5b5a35ff4805c2f2f071c6c51d095492406db750 /keyserver/internal
parenta7e67e65a8662387f1a5ba6860698743f9dbd60f (diff)
Fix edge cases around device lists (#1234)
* Fix New users appear in /keys/changes * Create blank device keys when logging in on a new device * Add PerformDeviceUpdate and fix a few bugs - Correct device deletion query on sqlite - Return no keys on /keys/query rather than an empty key * Unbreak sqlite properly * Use a real DB for currentstateserver integration tests * Race fix
Diffstat (limited to 'keyserver/internal')
-rw-r--r--keyserver/internal/internal.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/keyserver/internal/internal.go b/keyserver/internal/internal.go
index 480d1084..bb828663 100644
--- a/keyserver/internal/internal.go
+++ b/keyserver/internal/internal.go
@@ -206,6 +206,9 @@ func (a *KeyInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReques
res.DeviceKeys[userID] = make(map[string]json.RawMessage)
}
for _, dk := range deviceKeys {
+ if len(dk.KeyJSON) == 0 {
+ continue // don't include blank keys
+ }
// inject display name if known
dk.KeyJSON, _ = sjson.SetBytes(dk.KeyJSON, "unsigned", struct {
DisplayName string `json:"device_display_name,omitempty"`