summary refs log tree commit diff
path: root/synapse/appservice
diff options
context:
space:
mode:
authorLuke Barnard <lukebarnard1@users.noreply.github.com>2016-10-20 16:21:10 +0100
committerGitHub <noreply@github.com>2016-10-20 16:21:10 +0100
commite01a1bc92d907a2bbbb67b4cf9e57e992a2ab91c (patch)
tree57cd35aa57f91102045b694fcaee98be1fee95cb /synapse/appservice
parentMerge pull request #1164 from pik/error-codes (diff)
parentStyle (diff)
downloadsynapse-e01a1bc92d907a2bbbb67b4cf9e57e992a2ab91c.tar.xz
Merge pull request #1175 from matrix-org/luke/feature-configurable-as-rate-limiting
Allow Configurable Rate Limiting Per AS
Diffstat (limited to 'synapse/appservice')
-rw-r--r--synapse/appservice/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py
index 126a10efb7..91471f7e89 100644
--- a/synapse/appservice/__init__.py
+++ b/synapse/appservice/__init__.py
@@ -81,7 +81,7 @@ class ApplicationService(object):
     NS_LIST = [NS_USERS, NS_ALIASES, NS_ROOMS]
 
     def __init__(self, token, url=None, namespaces=None, hs_token=None,
-                 sender=None, id=None, protocols=None):
+                 sender=None, id=None, protocols=None, rate_limited=True):
         self.token = token
         self.url = url
         self.hs_token = hs_token
@@ -95,6 +95,8 @@ class ApplicationService(object):
         else:
             self.protocols = set()
 
+        self.rate_limited = rate_limited
+
     def _check_namespaces(self, namespaces):
         # Sanity check that it is of the form:
         # {
@@ -234,5 +236,8 @@ class ApplicationService(object):
     def is_exclusive_room(self, room_id):
         return self._is_exclusive(ApplicationService.NS_ROOMS, room_id)
 
+    def is_rate_limited(self):
+        return self.rate_limited
+
     def __str__(self):
         return "ApplicationService: %s" % (self.__dict__,)