summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2018-01-23 09:59:06 +0100
committerGitHub <noreply@github.com>2018-01-23 09:59:06 +0100
commitd32385336f2edf2c98ae9eb560bad9402860d7cc (patch)
tree2fdb50078d44edd69093f5c09ff3ffbf5946c1e2 /synapse
parentMerge pull request #2821 from matrix-org/rav/matthew_test_fixes (diff)
downloadsynapse-d32385336f2edf2c98ae9eb560bad9402860d7cc.tar.xz
add ?ts massaging for ASes (#2754)
blindly implement ?ts for AS. untested
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/client/v1/room.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 682a0af9fc..867ec8602c 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -195,15 +195,20 @@ class RoomSendEventRestServlet(ClientV1RestServlet):
         requester = yield self.auth.get_user_by_req(request, allow_guest=True)
         content = parse_json_object_from_request(request)
 
+        event_dict = {
+            "type": event_type,
+            "content": content,
+            "room_id": room_id,
+            "sender": requester.user.to_string(),
+        }
+
+        if 'ts' in request.args and requester.app_service:
+            event_dict['origin_server_ts'] = parse_integer(request, "ts", 0)
+
         msg_handler = self.handlers.message_handler
         event = yield msg_handler.create_and_send_nonmember_event(
             requester,
-            {
-                "type": event_type,
-                "content": content,
-                "room_id": room_id,
-                "sender": requester.user.to_string(),
-            },
+            event_dict,
             txn_id=txn_id,
         )