diff --git a/spec/TestClient.js b/spec/TestClient.js index 29b443f4a44..a3d2dcb8a4e 100644 --- a/spec/TestClient.js +++ b/spec/TestClient.js @@ -185,7 +185,7 @@ TestClient.prototype.expectKeyQuery = function(response) { 200, (path, content) => { Object.keys(response.device_keys).forEach((userId) => { expect(content.device_keys[userId]).toEqual( - {}, + [], "Expected key query for " + userId + ", got " + Object.keys(content.device_keys), ); diff --git a/spec/integ/matrix-client-crypto.spec.js b/spec/integ/matrix-client-crypto.spec.js index 8fe97ff2103..3ca72c32034 100644 --- a/spec/integ/matrix-client-crypto.spec.js +++ b/spec/integ/matrix-client-crypto.spec.js @@ -70,7 +70,7 @@ function expectAliQueryKeys() { aliTestClient.httpBackend.when("POST", "/keys/query") .respond(200, function(path, content) { expect(content.device_keys[bobUserId]).toEqual( - {}, + [], "Expected Alice to key query for " + bobUserId + ", got " + Object.keys(content.device_keys), ); @@ -98,7 +98,7 @@ function expectBobQueryKeys() { "POST", "/keys/query", ).respond(200, function(path, content) { expect(content.device_keys[aliUserId]).toEqual( - {}, + [], "Expected Bob to key query for " + aliUserId + ", got " + Object.keys(content.device_keys), ); diff --git a/spec/integ/matrix-client-methods.spec.js b/spec/integ/matrix-client-methods.spec.js index be241c9121b..b79fd26d716 100644 --- a/spec/integ/matrix-client-methods.spec.js +++ b/spec/integ/matrix-client-methods.spec.js @@ -347,8 +347,8 @@ describe("MatrixClient", function() { httpBackend.when("POST", "/keys/query").check(function(req) { expect(req.data).toEqual({device_keys: { - 'boris': {}, - 'chaz': {}, + 'boris': [], + 'chaz': [], }}); }).respond(200, { device_keys: { diff --git a/src/base-apis.js b/src/base-apis.js index 6491b1510d5..ce74ce8edd0 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -1757,7 +1757,7 @@ MatrixBaseApis.prototype.downloadKeysForUsers = function(userIds, opts) { content.token = opts.token; } userIds.forEach((u) => { - content.device_keys[u] = {}; + content.device_keys[u] = []; }); return this._http.authedRequest(undefined, "POST", "/keys/query", undefined, content);