Actually auth-check to ensure people can only send typing notifications for rooms they're actually in

This commit is contained in:
Paul "LeoNerd" Evans 2014-12-11 18:11:43 +00:00
parent 966c4b2b04
commit 5ebc994f84
2 changed files with 14 additions and 0 deletions

View file

@ -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
)