mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 00:02:34 +01:00
modules/client/room_keys/keys: Fix sessions request and response structure.
closes #142
This commit is contained in:
parent
fa46231e3a
commit
0a151a3a90
1 changed files with 16 additions and 4 deletions
|
@ -168,10 +168,17 @@ ircd::m::put_room_keys_keys(client &client,
|
|||
request["rooms"]
|
||||
};
|
||||
|
||||
for(const auto &[room_id, sessions] : rooms)
|
||||
for(const auto &[session_id, session] : json::object(sessions))
|
||||
for(const auto &[room_id, room_data] : rooms)
|
||||
{
|
||||
const json::object sessions
|
||||
{
|
||||
json::object(room_data)["sessions"]
|
||||
};
|
||||
|
||||
for(const auto &[session_id, session] : sessions)
|
||||
put_room_keys_keys_key(client, request, room_id, session_id, version, session);
|
||||
}
|
||||
}
|
||||
else if(!session_id)
|
||||
{
|
||||
const json::object &sessions
|
||||
|
@ -371,12 +378,17 @@ ircd::m::_get_room_keys_keys(client &client,
|
|||
if(_version != lex_cast(version))
|
||||
return true;
|
||||
|
||||
m::get(std::nothrow, event_idx, "content", [&sessions, &_session_id]
|
||||
const string_view &session_id
|
||||
{
|
||||
_session_id
|
||||
};
|
||||
|
||||
m::get(std::nothrow, event_idx, "content", [&sessions, &session_id]
|
||||
(const json::object &session)
|
||||
{
|
||||
json::stack::member
|
||||
{
|
||||
sessions, _session_id, session
|
||||
sessions, session_id, session
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue