0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-16 21:53:50 +01:00

Only ratelimit when sending the email

If we do the opposite, an event can arrive after or while sending the email and the 3PID invite event will get ratelimited.
This commit is contained in:
Brendan Abolivier 2019-06-28 16:04:05 +01:00
parent b339f6489f
commit 15d9fc31bd
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD

View file

@ -676,7 +676,7 @@ class RoomMemberHandler(object):
# We need to rate limit *before* we send out any 3PID invites, so we # We need to rate limit *before* we send out any 3PID invites, so we
# can't just rely on the standard ratelimiting of events. # can't just rely on the standard ratelimiting of events.
yield self.base_handler.ratelimit(requester, update=False) yield self.base_handler.ratelimit(requester)
can_invite = yield self.third_party_event_rules.check_threepid_can_be_invited( can_invite = yield self.third_party_event_rules.check_threepid_can_be_invited(
medium, address, room_id medium, address, room_id
@ -823,6 +823,7 @@ class RoomMemberHandler(object):
"sender": user.to_string(), "sender": user.to_string(),
"state_key": token, "state_key": token,
}, },
ratelimit=False,
txn_id=txn_id, txn_id=txn_id,
) )