summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-23 13:56:14 +0100
committerErik Johnston <erik@matrix.org>2016-09-23 14:00:52 +0100
commit22578545a05944284eab3ba7646e2c1c5c36e359 (patch)
tree2495932e4cf5e3296fcfd34f90f54f4da70ff65a /synapse/rest
parentMerge pull request #1136 from matrix-org/erikj/fix_signed_3pid (diff)
downloadsynapse-22578545a05944284eab3ba7646e2c1c5c36e359.tar.xz
Time out typing over federation
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/room.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 20889e4af0..010fbc7c32 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -705,12 +705,15 @@ class RoomTypingRestServlet(ClientV1RestServlet):
 
         yield self.presence_handler.bump_presence_active_time(requester.user)
 
+        # Limit timeout to stop people from setting silly typing timeouts.
+        timeout = min(content.get("timeout", 30000), 120000)
+
         if content["typing"]:
             yield self.typing_handler.started_typing(
                 target_user=target_user,
                 auth_user=requester.user,
                 room_id=room_id,
-                timeout=content.get("timeout", 30000),
+                timeout=timeout,
             )
         else:
             yield self.typing_handler.stopped_typing(