modules/client/rooms/event: Replace raw event response with client format.

This commit is contained in:
Jason Volk 2023-04-28 13:02:04 -07:00
parent a7a3275817
commit 8eb10c5d1a
1 changed files with 25 additions and 1 deletions

View File

@ -46,8 +46,32 @@ get__event(client &client,
event_id, fopts
};
const unique_mutable_buffer buf
{
m::event::MAX_SIZE
};
json::stack out{buf};
{
json::stack::object top{out};
m::event::append
{
top, event,
{
.event_idx = &event.event_idx,
.user_id = &request.user_id,
.query_prev_state = false,
.query_redacted = false,
.query_visible = false,
}
};
};
return m::resource::response
{
client, event.source
client, json::object
{
out.completed()
}
};
}