summary refs log tree commit diff
path: root/synapse/rest/client/v1/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-10-11 14:08:29 +0100
committerErik Johnston <erik@matrix.org>2016-10-11 14:08:29 +0100
commit3061dac53eef21110d8d9f08554f28c562175a18 (patch)
tree51a8cb5ed3f294887bdcc2d6ef36efcad186af07 /synapse/rest/client/v1/room.py
parentFix check of wrong variable (diff)
parentMerge pull request #1166 from matrix-org/rav/grandfather_broken_riot_signup (diff)
downloadsynapse-3061dac53eef21110d8d9f08554f28c562175a18.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/replication_noop
Diffstat (limited to 'synapse/rest/client/v1/room.py')
-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(