Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
mtxclient
Commits
9876a75f
Verified
Commit
9876a75f
authored
1 year ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Store errors as strings to speed up compilation
parent
f878e294
Branches
reportContent
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#5210
passed
1 year ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/mtx/responses/crypto.hpp
+2
-2
2 additions, 2 deletions
include/mtx/responses/crypto.hpp
lib/structs/responses/crypto.cpp
+13
-5
13 additions, 5 deletions
lib/structs/responses/crypto.cpp
with
15 additions
and
7 deletions
include/mtx/responses/crypto.hpp
+
2
−
2
View file @
9876a75f
...
...
@@ -35,7 +35,7 @@ struct QueryKeys
//! If any remote homeservers could not be reached, they are
//! recorded here. The names of the properties are the names
//! of the unreachable servers.
std
::
map
<
std
::
string
,
nlohmann
::
json
>
failures
;
std
::
map
<
std
::
string
,
std
::
string
>
failures
;
//! Information on the queried devices.
//! A map from user ID, to a map from device ID to device information.
//! For each device, the information returned will be the same
...
...
@@ -67,7 +67,7 @@ struct ClaimKeys
//! If any remote homeservers could not be reached, they are
//! recorded here. The names of the properties are the names
//! of the unreachable servers.
std
::
map
<
std
::
string
,
nlohmann
::
json
>
failures
;
std
::
map
<
std
::
string
,
std
::
string
>
failures
;
//! One-time keys for the queried devices. A map from user ID,
//! to a map from <algorithm>:<key_id> to the key object.
std
::
map
<
std
::
string
,
std
::
map
<
std
::
string
,
nlohmann
::
json
>>
one_time_keys
;
...
...
This diff is collapsed.
Click to expand it.
lib/structs/responses/crypto.cpp
+
13
−
5
View file @
9876a75f
...
...
@@ -15,8 +15,11 @@ from_json(const nlohmann::json &obj, UploadKeys &response)
void
from_json
(
const
nlohmann
::
json
&
obj
,
QueryKeys
&
response
)
{
if
(
obj
.
contains
(
"failures"
))
response
.
failures
=
obj
.
at
(
"failures"
).
get
<
std
::
map
<
std
::
string
,
nlohmann
::
json
>>
();
if
(
obj
.
contains
(
"failures"
))
{
for
(
const
auto
&
[
key
,
value
]
:
obj
.
at
(
"failures"
).
get
<
std
::
map
<
std
::
string
,
nlohmann
::
json
>>
())
response
.
failures
[
key
]
=
value
.
dump
();
}
if
(
obj
.
contains
(
"device_keys"
))
response
.
device_keys
=
obj
.
at
(
"device_keys"
).
get
<
std
::
map
<
std
::
string
,
DeviceToKeysMap
>>
();
if
(
obj
.
contains
(
"master_keys"
))
...
...
@@ -33,7 +36,9 @@ from_json(const nlohmann::json &obj, QueryKeys &response)
void
to_json
(
nlohmann
::
json
&
obj
,
const
QueryKeys
&
response
)
{
obj
[
"failures"
]
=
response
.
failures
;
for
(
const
auto
&
[
key
,
value
]
:
response
.
failures
)
obj
[
"failures"
][
key
]
=
nlohmann
::
json
::
parse
(
value
);
obj
[
"device_keys"
]
=
response
.
device_keys
;
obj
[
"master_keys"
]
=
response
.
master_keys
;
obj
[
"user_signing_keys"
]
=
response
.
user_signing_keys
;
...
...
@@ -50,8 +55,11 @@ from_json(const nlohmann::json &obj, KeySignaturesUpload &response)
void
from_json
(
const
nlohmann
::
json
&
obj
,
ClaimKeys
&
response
)
{
if
(
obj
.
contains
(
"failures"
))
response
.
failures
=
obj
.
at
(
"failures"
).
get
<
std
::
map
<
std
::
string
,
nlohmann
::
json
>>
();
if
(
obj
.
contains
(
"failures"
))
{
for
(
const
auto
&
[
key
,
value
]
:
obj
.
at
(
"failures"
).
get
<
std
::
map
<
std
::
string
,
nlohmann
::
json
>>
())
response
.
failures
[
key
]
=
value
.
dump
();
}
if
(
obj
.
contains
(
"one_time_keys"
))
response
.
one_time_keys
=
obj
.
at
(
"one_time_keys"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment