Send IDs over to keyserver internal API

This commit is contained in:
Neil Alexander 2021-02-26 10:53:53 +00:00
parent f999e58a6f
commit faffc1be3c
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 7 additions and 2 deletions

View file

@ -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{
{

View file

@ -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 {