aboutsummaryrefslogtreecommitdiff
path: root/keyserver/internal
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-07-30 11:15:46 +0100
committerGitHub <noreply@github.com>2020-07-30 11:15:46 +0100
commit9355fb5ac8c911bdbde6dcc0f279f716d8a8f60b (patch)
treec6a155f7b65e25c8ab4abaf7413fbb0531a02b12 /keyserver/internal
parent0fdd4f14d123e76bd3d0368947d3aab84a787946 (diff)
Hook up device list updates to the sync notifier (#1231)
* WIP hooking up key changes * Fix import cycle, get tests passing and binary compiling * Linting and update whitelist
Diffstat (limited to 'keyserver/internal')
-rw-r--r--keyserver/internal/internal.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/keyserver/internal/internal.go b/keyserver/internal/internal.go
index 240a5640..9a41e44f 100644
--- a/keyserver/internal/internal.go
+++ b/keyserver/internal/internal.go
@@ -41,6 +41,9 @@ type KeyInternalAPI struct {
}
func (a *KeyInternalAPI) QueryKeyChanges(ctx context.Context, req *api.QueryKeyChangesRequest, res *api.QueryKeyChangesResponse) {
+ if req.Partition < 0 {
+ req.Partition = a.Producer.DefaultPartition()
+ }
userIDs, latest, err := a.DB.KeyChanges(ctx, req.Partition, req.Offset)
if err != nil {
res.Error = &api.KeyError{
@@ -48,6 +51,7 @@ func (a *KeyInternalAPI) QueryKeyChanges(ctx context.Context, req *api.QueryKeyC
}
}
res.Offset = latest
+ res.Partition = req.Partition
res.UserIDs = userIDs
}