mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 08:33:48 +01:00
Merge pull request #8467 from matrix-org/rav/fix_3pevent_rules
Fix third-party event modules for `check_visibility_can_be_modified` check
This commit is contained in:
commit
9c0b168cff
3 changed files with 5 additions and 2 deletions
1
changelog.d/8467.feature
Normal file
1
changelog.d/8467.feature
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Allow `ThirdPartyEventRules` modules to query and manipulate whether a room is in the public rooms directory.
|
|
@ -131,7 +131,9 @@ class ThirdPartyEventRules:
|
||||||
if self.third_party_rules is None:
|
if self.third_party_rules is None:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
check_func = getattr(self.third_party_rules, "check_visibility_can_be_modified")
|
check_func = getattr(
|
||||||
|
self.third_party_rules, "check_visibility_can_be_modified", None
|
||||||
|
)
|
||||||
if not check_func or not isinstance(check_func, Callable):
|
if not check_func or not isinstance(check_func, Callable):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ThirdPartyRulesTestCase(unittest.HomeserverTestCase):
|
||||||
def make_homeserver(self, reactor, clock):
|
def make_homeserver(self, reactor, clock):
|
||||||
config = self.default_config()
|
config = self.default_config()
|
||||||
config["third_party_event_rules"] = {
|
config["third_party_event_rules"] = {
|
||||||
"module": "tests.rest.client.third_party_rules.ThirdPartyRulesTestModule",
|
"module": __name__ + ".ThirdPartyRulesTestModule",
|
||||||
"config": {},
|
"config": {},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue