diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-10-06 12:30:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 12:30:24 +0200 |
commit | ec5d1d681d1362f5746c5cb45e93829d6a68aa4d (patch) | |
tree | 697a5b89a5498faa1adb45ffc89b15e5e8b86fcb /clientapi | |
parent | 3f82bceb70050c1233b7de6d87ffa5510596d145 (diff) |
Always return `one_time_key_counts` on `/keys/upload` (#2769)
The OTK count is
[required](https://spec.matrix.org/v1.4/client-server-api/#post_matrixclientv3keysupload)
in responses to `/keys/upload`, so return those.
Diffstat (limited to 'clientapi')
-rw-r--r-- | clientapi/routing/keys.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clientapi/routing/keys.go b/clientapi/routing/keys.go index b7a76b47..5c368138 100644 --- a/clientapi/routing/keys.go +++ b/clientapi/routing/keys.go @@ -19,11 +19,12 @@ import ( "net/http" "time" + "github.com/matrix-org/util" + "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" "github.com/matrix-org/dendrite/keyserver/api" userapi "github.com/matrix-org/dendrite/userapi/api" - "github.com/matrix-org/util" ) type uploadKeysRequest struct { @@ -77,7 +78,6 @@ func UploadKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Devi } } keyCount := make(map[string]int) - // we only return key counts when the client uploads OTKs if len(uploadRes.OneTimeKeyCounts) > 0 { keyCount = uploadRes.OneTimeKeyCounts[0].KeyCount } |