summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-09-26 11:24:14 +0100
committerGitHub <noreply@github.com>2016-09-26 11:24:14 +0100
commita38d46249e5c9d9f5ac0276dce1c26320436d8e5 (patch)
treeb654c4551f2ac1ddf8a49a9109e5a8e1780e766e /synapse/rest/client
parenttypo (diff)
parentMove FEDERATION_PING_INTERVAL timer. Update log line (diff)
downloadsynapse-a38d46249e5c9d9f5ac0276dce1c26320436d8e5.tar.xz
Merge pull request #1140 from matrix-org/erikj/typing_fed_timeout
Time out typing over federation
Diffstat (limited to 'synapse/rest/client')
-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(