From faffc1be3c92799be44ac9f24a82f035eac19009 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 26 Feb 2021 10:53:53 +0000 Subject: [PATCH] Send IDs over to keyserver internal API --- clientapi/routing/keys.go | 5 ++++- keyserver/internal/internal.go | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/keys.go b/clientapi/routing/keys.go index ba03a352f..e22336428 100644 --- a/clientapi/routing/keys.go +++ b/clientapi/routing/keys.go @@ -38,7 +38,10 @@ func UploadKeys(req *http.Request, keyAPI api.KeyInternalAPI, device *userapi.De return *resErr } - uploadReq := &api.PerformUploadKeysRequest{} + uploadReq := &api.PerformUploadKeysRequest{ + DeviceID: device.ID, + UserID: device.UserID, + } if r.DeviceKeys != nil { uploadReq.DeviceKeys = []api.DeviceKeys{ { diff --git a/keyserver/internal/internal.go b/keyserver/internal/internal.go index 3305043f0..beb165f4e 100644 --- a/keyserver/internal/internal.go +++ b/keyserver/internal/internal.go @@ -520,7 +520,9 @@ func (a *KeyInternalAPI) uploadOneTimeKeys(ctx context.Context, req *api.Perform Err: fmt.Sprintf("a.DB.OneTimeKeysCount: %s", err), } } - res.OneTimeKeyCounts = append(res.OneTimeKeyCounts, *counts) + if counts != nil { + res.OneTimeKeyCounts = append(res.OneTimeKeyCounts, *counts) + } return } for _, key := range req.OneTimeKeys {