summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-16 16:10:17 +0000
committerErik Johnston <erik@matrix.org>2014-12-16 16:10:17 +0000
commitf06161a3077723a47772cbefc08a4bf2f14b176b (patch)
tree502c40dd551621959d86fa2f774655fde707eb08 /synapse/handlers
parentFix typo where we thought a list was a dict (diff)
downloadsynapse-f06161a3077723a47772cbefc08a4bf2f14b176b.tar.xz
Enable rate limiting for all events
Diffstat (limited to '')
-rw-r--r--synapse/handlers/message.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index baf372fdad..7939d2bffa 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -154,6 +154,11 @@ class MessageHandler(BaseHandler):
 
         self.validator.validate_new(builder)
 
+        self.ratelimit(builder.user_id)
+        # TODO(paul): Why does 'event' not have a 'user' object?
+        user = self.hs.parse_userid(builder.user_id)
+        assert self.hs.is_mine(user), "User must be our own: %s" % (user,)
+
         if builder.type == EventTypes.Member:
             membership = builder.content.get("membership", None)
             if membership == Membership.JOIN: