From ffcb6d2ea199cfa985e72ffbdcb884fb9bc9f54d Mon Sep 17 00:00:00 2001 From: Kegsay Date: Mon, 3 Aug 2020 12:29:58 +0100 Subject: Produce OTK counts in /sync response (#1235) * Add QueryOneTimeKeys for /sync extensions * Unbreak tests * Produce OTK counts in /sync response * Linting --- keyserver/api/api.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'keyserver/api/api.go') diff --git a/keyserver/api/api.go b/keyserver/api/api.go index 6795498f..eb2f9e24 100644 --- a/keyserver/api/api.go +++ b/keyserver/api/api.go @@ -31,6 +31,7 @@ type KeyInternalAPI interface { PerformClaimKeys(ctx context.Context, req *PerformClaimKeysRequest, res *PerformClaimKeysResponse) QueryKeys(ctx context.Context, req *QueryKeysRequest, res *QueryKeysResponse) QueryKeyChanges(ctx context.Context, req *QueryKeyChangesRequest, res *QueryKeyChangesResponse) + QueryOneTimeKeys(ctx context.Context, req *QueryOneTimeKeysRequest, res *QueryOneTimeKeysResponse) } // KeyError is returned if there was a problem performing/querying the server @@ -157,3 +158,16 @@ type QueryKeyChangesResponse struct { // Set if there was a problem handling the request. Error *KeyError } + +type QueryOneTimeKeysRequest struct { + // The local user to query OTK counts for + UserID string + // The device to query OTK counts for + DeviceID string +} + +type QueryOneTimeKeysResponse struct { + // OTK key counts, in the extended /sync form described by https://matrix.org/docs/spec/client_server/r0.6.1#id84 + Count OneTimeKeysCount + Error *KeyError +} -- cgit v1.2.3