summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-12-11 18:11:43 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-12-11 18:11:43 +0000
commit5ebc994f841508beb48f06d22073e08845c5f593 (patch)
tree453aea70ac99691e4c4cd9ab71b9e100bad109f9 /synapse/handlers
parentAdd a sprinkling of logger.debug() into typing notification handler (diff)
downloadsynapse-5ebc994f841508beb48f06d22073e08845c5f593.tar.xz
Actually auth-check to ensure people can only send typing notifications for rooms they're actually in
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/typing.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/typing.py b/synapse/handlers/typing.py
index c55221c6df..fa903c251c 100644
--- a/synapse/handlers/typing.py
+++ b/synapse/handlers/typing.py
@@ -67,6 +67,8 @@ class TypingNotificationHandler(BaseHandler):
         if target_user != auth_user:
             raise AuthError(400, "Cannot set another user's typing state")
 
+        yield self.auth.check_joined_room(room_id, target_user.to_string())
+
         logger.debug(
             "%s has started typing in %s", target_user.to_string(), room_id
         )
@@ -102,6 +104,8 @@ class TypingNotificationHandler(BaseHandler):
         if target_user != auth_user:
             raise AuthError(400, "Cannot set another user's typing state")
 
+        yield self.auth.check_joined_room(room_id, target_user.to_string())
+
         logger.debug(
             "%s has stopped typing in %s", target_user.to_string(), room_id
         )