summary refs log tree commit diff
path: root/synapse/rest/client/v1/room.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2016-01-14 11:17:29 +0000
committerRichard van der Hoff <github@rvanderhoff.org.uk>2016-01-14 11:17:29 +0000
commit7ee1879ed467fc8605403e396c965f57465fe840 (patch)
treef88e43925281cf8a0d9faa620eb16d4d104a6062 /synapse/rest/client/v1/room.py
parentSkip, rather than erroring, invalid guest requests (diff)
parentAdd 'event' result to 'context' endpoint (diff)
downloadsynapse-7ee1879ed467fc8605403e396c965f57465fe840.tar.xz
Merge pull request #492 from matrix-org/rav/event_context_shiz_release github/release-v0.12.1 release-v0.12.1
Add 'event' result to 'context' endpoint
Diffstat (limited to 'synapse/rest/client/v1/room.py')
-rw-r--r--synapse/rest/client/v1/room.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 6fe53f70e5..62ce0f066b 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -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"]
         ]