0
0
Fork 0
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:
Jason Volk 2023-04-19 20:57:28 -07:00
parent fa46231e3a
commit 0a151a3a90

View file

@ -168,9 +168,16 @@ ircd::m::put_room_keys_keys(client &client,
request["rooms"] request["rooms"]
}; };
for(const auto &[room_id, sessions] : rooms) for(const auto &[room_id, room_data] : rooms)
for(const auto &[session_id, session] : json::object(sessions)) {
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); put_room_keys_keys_key(client, request, room_id, session_id, version, session);
}
} }
else if(!session_id) else if(!session_id)
{ {
@ -371,12 +378,17 @@ ircd::m::_get_room_keys_keys(client &client,
if(_version != lex_cast(version)) if(_version != lex_cast(version))
return true; 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) (const json::object &session)
{ {
json::stack::member json::stack::member
{ {
sessions, _session_id, session sessions, session_id, session
}; };
}); });