mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Add 'event' result to 'context' endpoint
... because the context isn't much use without the event.
This commit is contained in:
parent
93afb40cd4
commit
49f33f6438
2 changed files with 29 additions and 12 deletions
|
@ -402,10 +402,16 @@ class RoomEventContext(ClientV1RestServlet):
|
|||
user, room_id, event_id, limit, is_guest
|
||||
)
|
||||
|
||||
if not results:
|
||||
raise SynapseError(
|
||||
404, "Event not found.", errcode=Codes.NOT_FOUND
|
||||
)
|
||||
|
||||
time_now = self.clock.time_msec()
|
||||
results["events_before"] = [
|
||||
serialize_event(event, time_now) for event in results["events_before"]
|
||||
]
|
||||
results["event"] = serialize_event(results["event"], time_now)
|
||||
results["events_after"] = [
|
||||
serialize_event(event, time_now) for event in results["events_after"]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue