summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-10-09 19:18:09 +0100
committerMark Haines <mark.haines@matrix.org>2015-10-09 19:18:09 +0100
commitaf7b21447648cba477542bc1786be2a6c0928e37 (patch)
tree74c4481acd515a180c0edeb05d1a03b52ba30fd6 /synapse/rest/client/v2_alpha
parentFormat the presence events correctly for v2 (diff)
parentSplit the sections of EventStreamHandler.get_stream that handle presence (diff)
downloadsynapse-af7b21447648cba477542bc1786be2a6c0928e37.tar.xz
Merge branch 'markjh/eventstream_presence' into markjh/v2_sync_api
Diffstat (limited to 'synapse/rest/client/v2_alpha')
-rw-r--r--synapse/rest/client/v2_alpha/receipts.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/receipts.py b/synapse/rest/client/v2_alpha/receipts.py
index 52e99f54d5..b107b7ce17 100644
--- a/synapse/rest/client/v2_alpha/receipts.py
+++ b/synapse/rest/client/v2_alpha/receipts.py
@@ -15,6 +15,7 @@
 
 from twisted.internet import defer
 
+from synapse.api.errors import SynapseError
 from synapse.http.servlet import RestServlet
 from ._base import client_v2_pattern
 
@@ -41,6 +42,9 @@ class ReceiptRestServlet(RestServlet):
     def on_POST(self, request, room_id, receipt_type, event_id):
         user, _ = yield self.auth.get_user_by_req(request)
 
+        if receipt_type != "m.read":
+            raise SynapseError(400, "Receipt type must be 'm.read'")
+
         yield self.receipts_handler.received_client_receipt(
             room_id,
             receipt_type,