Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Don't ratelimit room create events
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Haines committed Dec 19, 2014
1 parent 45a6869 commit a999f0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion synapse/handlers/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ def send_room_alias_update_event(self, user_id, room_id):
"room_id": room_id,
"sender": user_id,
"content": {"aliases": aliases},
})
}, ratelimit=False)
5 changes: 3 additions & 2 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_messages(self, user_id=None, room_id=None, pagin_config=None,
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,
Expand All @@ -123,7 +123,8 @@ def create_and_send_event(self, event_dict):

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,)
Expand Down

0 comments on commit a999f0d

Please sign in to comment.