mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Use real AS object by passing it through the requester
This means synapse does not have to check if the AS is interested, but instead it effectively re-uses what it already knew about the requesting user
This commit is contained in:
parent
5b54d51d1e
commit
1b17d1a106
3 changed files with 15 additions and 18 deletions
|
@ -65,14 +65,9 @@ class BaseHandler(object):
|
|||
if app_service is not None:
|
||||
return # do not ratelimit app service senders
|
||||
|
||||
should_rate_limit = True
|
||||
|
||||
for service in self.store.get_app_services():
|
||||
if service.is_interested_in_user(user_id):
|
||||
should_rate_limit = service.is_rate_limited()
|
||||
break
|
||||
|
||||
if not should_rate_limit:
|
||||
if requester.as_user and not requester.as_user.is_rate_limited():
|
||||
# do not ratelimit users of which a non-rate-limited AS is
|
||||
# acting on behalf
|
||||
return
|
||||
|
||||
allowed, time_allowed = self.ratelimiter.send_message(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue