Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 4cd1448

Browse files
committed
Fix third-party event modules for check_visibility_can_be_modified check
PR #8292 tried to maintain backwards compat with modules which don't provide a `check_visibility_can_be_modified` method, but the tests weren't being run, and the check didn't work.
1 parent da11cc2 commit 4cd1448

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

changelog.d/8467.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow `ThirdPartyEventRules` modules to query and manipulate whether a room is in the public rooms directory.

synapse/events/third_party_rules.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ async def check_visibility_can_be_modified(
131131
if self.third_party_rules is None:
132132
return True
133133

134-
check_func = getattr(self.third_party_rules, "check_visibility_can_be_modified")
134+
check_func = getattr(
135+
self.third_party_rules, "check_visibility_can_be_modified", None
136+
)
135137
if not check_func or not isinstance(check_func, Callable):
136138
return True
137139

tests/rest/client/third_party_rules.py renamed to tests/rest/client/test_third_party_rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ThirdPartyRulesTestCase(unittest.HomeserverTestCase):
4949
def make_homeserver(self, reactor, clock):
5050
config = self.default_config()
5151
config["third_party_event_rules"] = {
52-
"module": "tests.rest.client.third_party_rules.ThirdPartyRulesTestModule",
52+
"module": __name__ + ".ThirdPartyRulesTestModule",
5353
"config": {},
5454
}
5555

0 commit comments

Comments
 (0)