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

Commit

Permalink
Rate limit early
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed May 2, 2019
1 parent d6118c5 commit 176f31c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,9 @@ def do_3pid_invite(
Codes.FORBIDDEN,
)

# Check whether we'll be ratelimited
yield self.base_handler.ratelimit(requester, update=False)
# We need to rate limit *before* we send out any 3PID invites, so we
# can't just rely on the standard ratelimiting of events.
yield self.base_handler.ratelimit(requester)

invitee = yield self._lookup_3pid(
id_server, medium, address
Expand Down

0 comments on commit 176f31c

Please sign in to comment.