mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Clean up a bit
This commit is contained in:
parent
dd33f2b76d
commit
ad05e3de6e
1 changed files with 7 additions and 14 deletions
|
@ -112,22 +112,15 @@ func QueryKeys(req *http.Request, keyAPI api.KeyInternalAPI) util.JSONResponse {
|
|||
Timeout: r.GetTimeout(),
|
||||
// TODO: Token?
|
||||
}, &queryRes)
|
||||
res := map[string]interface{}{
|
||||
"device_keys": queryRes.DeviceKeys,
|
||||
"failures": queryRes.Failures,
|
||||
}
|
||||
if k := queryRes.MasterKeys; k != nil {
|
||||
res["master_keys"] = k
|
||||
}
|
||||
if k := queryRes.SelfSigningKeys; k != nil {
|
||||
res["self_signing_keys"] = k
|
||||
}
|
||||
if k := queryRes.UserSigningKeys; k != nil {
|
||||
res["user_signing_keys"] = k
|
||||
}
|
||||
return util.JSONResponse{
|
||||
Code: 200,
|
||||
JSON: res,
|
||||
JSON: map[string]interface{}{
|
||||
"device_keys": queryRes.DeviceKeys,
|
||||
"master_keys": queryRes.MasterKeys,
|
||||
"self_signing_keys": queryRes.SelfSigningKeys,
|
||||
"user_signing_keys": queryRes.UserSigningKeys,
|
||||
"failures": queryRes.Failures,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue