diff options
author | Luke Barnard <lukeb@openmarket.com> | 2016-10-20 12:04:54 +0100 |
---|---|---|
committer | Luke Barnard <lukeb@openmarket.com> | 2016-10-20 12:04:54 +0100 |
commit | f09db236b1867a20ef1328af40a2422bca35944e (patch) | |
tree | fbb76e62a298621c517934d6a8c32943509e6c31 /synapse/handlers/_base.py | |
parent | flake8 (diff) | |
download | synapse-f09db236b1867a20ef1328af40a2422bca35944e.tar.xz |
as_user->app_service, less redundant comments, better positioned comments
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r-- | synapse/handlers/_base.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py index ba62746214..90f96209f8 100644 --- a/synapse/handlers/_base.py +++ b/synapse/handlers/_base.py @@ -57,17 +57,14 @@ class BaseHandler(object): time_now = self.clock.time() user_id = requester.user.to_string() - # Disable rate limiting of users belonging to any AS that is configured - # not to be rate limited in its registration file (rate_limited: true|false). # The AS user itself is never rate limited. - app_service = self.store.get_app_service_by_user_id(user_id) if app_service is not None: return # do not ratelimit app service senders - 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 + # Disable rate limiting of users belonging to any AS that is configured + # not to be rate limited in its registration file (rate_limited: true|false). + if requester.app_service and not requester.app_service.is_rate_limited(): return allowed, time_allowed = self.ratelimiter.send_message( |