summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-01-14 15:04:08 +0000
committerRichard van der Hoff <richard@matrix.org>2016-01-14 15:04:08 +0000
commit2978053d167ab8daef0213c04d634bf9dcd8143b (patch)
treeee0a21ca58d124bd9a83363ce079066ef8fadcef /synapse/rest/client
parentMerge pull request #496 from matrix-org/daniel/3 (diff)
parentMerge pull request #492 from matrix-org/rav/event_context_shiz_release (diff)
downloadsynapse-2978053d167ab8daef0213c04d634bf9dcd8143b.tar.xz
Merge branch 'release-v0.12.1' into develop
Diffstat (limited to 'synapse/rest/client')
-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 7496b26735..8b1b2b852d 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -414,10 +414,16 @@ class RoomEventContext(ClientV1RestServlet):
             requester.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"]
         ]