From 4ef5d4b3b844e9a90c35d1b35e1b03e3bf4230e7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 31 Aug 2020 14:24:09 +0200 Subject: [PATCH] implement hsapi /keys/query method --- src/matrix/e2ee/DeviceTracker.js | 2 +- src/matrix/net/HomeServerApi.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/matrix/e2ee/DeviceTracker.js b/src/matrix/e2ee/DeviceTracker.js index e13b3a5c..032f5648 100644 --- a/src/matrix/e2ee/DeviceTracker.js +++ b/src/matrix/e2ee/DeviceTracker.js @@ -137,7 +137,7 @@ export class DeviceTracker { // TODO: we need to handle the race here between /sync and /keys/query just like we need to do for the member list ... // there are multiple requests going out for /keys/query though and only one for /members - const deviceKeyResponse = await hsApi.keysQuery({ + const deviceKeyResponse = await hsApi.queryKeys({ "timeout": 10000, "device_keys": userIds.reduce((deviceKeysMap, userId) => { deviceKeysMap[userId] = []; diff --git a/src/matrix/net/HomeServerApi.js b/src/matrix/net/HomeServerApi.js index ac55f0a5..42d1b0e0 100644 --- a/src/matrix/net/HomeServerApi.js +++ b/src/matrix/net/HomeServerApi.js @@ -164,6 +164,10 @@ export class HomeServerApi { return this._post("/keys/upload", null, payload, options); } + queryKeys(queryRequest, options = null) { + return this._post("/keys/query", null, queryRequest, options); + } + get mediaRepository() { return this._mediaRepository; }