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 /keyserver | |
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 'keyserver')
-rw-r--r-- | keyserver/internal/internal.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/keyserver/internal/internal.go b/keyserver/internal/internal.go index 017c29e8..a0280dff 100644 --- a/keyserver/internal/internal.go +++ b/keyserver/internal/internal.go @@ -70,6 +70,11 @@ func (a *KeyInternalAPI) PerformUploadKeys(ctx context.Context, req *api.Perform if len(req.OneTimeKeys) > 0 { a.uploadOneTimeKeys(ctx, req, res) } + otks, err := a.DB.OneTimeKeysCount(ctx, req.UserID, req.DeviceID) + if err != nil { + return err + } + res.OneTimeKeyCounts = []api.OneTimeKeysCount{*otks} return nil } |