summary refs log tree commit diff
path: root/synapse/config
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/config
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/config')
-rw-r--r--synapse/config/appservice.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/config/appservice.py b/synapse/config/appservice.py
index d7537e8d44..82c50b8240 100644
--- a/synapse/config/appservice.py
+++ b/synapse/config/appservice.py
@@ -110,6 +110,11 @@ def _load_appservice(hostname, as_info, config_filename):
     user = UserID(localpart, hostname)
     user_id = user.to_string()
 
+    # Rate limiting for users of this AS is on by default (excludes sender)
+    rate_limited = True
+    if isinstance(as_info.get("rate_limited"), bool):
+        rate_limited = as_info.get("rate_limited")
+
     # namespace checks
     if not isinstance(as_info.get("namespaces"), dict):
         raise KeyError("Requires 'namespaces' object.")
@@ -155,4 +160,5 @@ def _load_appservice(hostname, as_info, config_filename):
         sender=user_id,
         id=as_info["id"],
         protocols=protocols,
+        rate_limited=rate_limited
     )