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.
This commit is contained in:
Richard van der Hoff 2020-10-07 12:03:26 +01:00 committed by GitHub
parent 01f82bfe32
commit 4f0637346a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 51 additions and 58 deletions

View file

@ -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(