summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-19 14:18:27 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-19 14:18:27 +0000
commita999f0dec3b9ec12f8fe605c6d08d226c4d87ae8 (patch)
tree588b337b581c638bb7a6ffb22791e4d213dcb37f /synapse/handlers
parentMerge branch 'release-v0.6.0' (diff)
downloadsynapse-a999f0dec3b9ec12f8fe605c6d08d226c4d87ae8.tar.xz
Don't ratelimit room create events
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/directory.py2
-rw-r--r--synapse/handlers/message.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 66d3b533d9..a907a66e12 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -155,4 +155,4 @@ class DirectoryHandler(BaseHandler):
             "room_id": room_id,
             "sender": user_id,
             "content": {"aliases": aliases},
-        })
+        }, ratelimit=False)
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 49c0e98113..01a7183548 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -106,7 +106,7 @@ class MessageHandler(BaseHandler):
         defer.returnValue(chunk)
 
     @defer.inlineCallbacks
-    def create_and_send_event(self, event_dict):
+    def create_and_send_event(self, event_dict, ratelimit=True):
         """ Given a dict from a client, create and handle a new event.
 
         Creates an FrozenEvent object, filling out auth_events, prev_events,
@@ -123,7 +123,8 @@ class MessageHandler(BaseHandler):
 
         self.validator.validate_new(builder)
 
-        self.ratelimit(builder.user_id)
+        if ratelimit:
+            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,)