mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:Ⓜ️ Complete the room state tuple buffer constructor.
This commit is contained in:
parent
0839d929c8
commit
997da91477
1 changed files with 24 additions and 1 deletions
|
@ -1582,9 +1582,32 @@ const
|
|||
//
|
||||
|
||||
ircd::m::room::state::tuple::tuple(const m::room &room,
|
||||
const mutable_buffer &buf)
|
||||
const mutable_buffer &buf_)
|
||||
{
|
||||
const m::room::state state
|
||||
{
|
||||
room
|
||||
};
|
||||
|
||||
window_buffer buf{buf_};
|
||||
json::for_each(*this, [&state, &buf]
|
||||
(const string_view &type, auto &event)
|
||||
{
|
||||
state.get(std::nothrow, type, "", [&buf, &event]
|
||||
(const event::idx &event_idx)
|
||||
{
|
||||
buf([&event, &event_idx]
|
||||
(const mutable_buffer &buf)
|
||||
{
|
||||
event = m::event
|
||||
{
|
||||
event_idx, buf
|
||||
};
|
||||
|
||||
return serialized(event);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
ircd::m::room::state::tuple::tuple(const json::array &pdus)
|
||||
|
|
Loading…
Reference in a new issue