summary refs log tree commit diff
path: root/synapse/events/third_party_rules.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-10-07 12:03:26 +0100
committerGitHub <noreply@github.com>2020-10-07 12:03:26 +0100
commit4f0637346a194a3343b4fea6cf38c1548e56648d (patch)
treef0aec40f179e6cb5648df8797e4c15e791e37ec6 /synapse/events/third_party_rules.py
parentRemove docs/sphinx and related references (#8480) (diff)
downloadsynapse-4f0637346a194a3343b4fea6cf38c1548e56648d.tar.xz
Combine `SpamCheckerApi` with the more generic `ModuleApi`. (#8464)
Lots of different module apis is not easy to maintain.

Rather than adding yet another ModuleApi(hs, hs.get_auth_handler()) incantation, first add an hs.get_module_api() method and use it where possible.
Diffstat (limited to 'synapse/events/third_party_rules.py')
-rw-r--r--synapse/events/third_party_rules.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/events/third_party_rules.py b/synapse/events/third_party_rules.py
index e38b8e67fb..1535cc5339 100644
--- a/synapse/events/third_party_rules.py
+++ b/synapse/events/third_party_rules.py
@@ -16,7 +16,6 @@ from typing import Callable
 
 from synapse.events import EventBase
 from synapse.events.snapshot import EventContext
-from synapse.module_api import ModuleApi
 from synapse.types import Requester, StateMap
 
 
@@ -40,7 +39,7 @@ class ThirdPartyEventRules:
 
         if module is not None:
             self.third_party_rules = module(
-                config=config, module_api=ModuleApi(hs, hs.get_auth_handler()),
+                config=config, module_api=hs.get_module_api(),
             )
 
     async def check_event_allowed(