mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 08:46:04 -04:00
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:
parent
01f82bfe32
commit
4f0637346a
10 changed files with 51 additions and 58 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue