Skip to content

Commit

Permalink
modules/client/rooms/event: Replace raw event response with client fo…
Browse files Browse the repository at this point in the history
…rmat.
  • Loading branch information
jevolk committed Apr 28, 2023
1 parent a7a3275 commit 8eb10c5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion modules/client/rooms/event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
};
}

0 comments on commit 8eb10c5

Please sign in to comment.