Adopt MSC4506 identifiers for the knock push rule

The knock push rules MSC has been published as MSC4506: rename the
experimental flag to msc4506_enabled, the rule id to
.org.matrix.msc4506.rule.knock and the condition kind to
org.matrix.msc4506.recipient_permission per its unstable prefix section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
This commit is contained in:
Matthew Hodgson
2026-07-14 13:23:26 +01:00
co-authored by Claude Fable 5
parent c24038ff6f
commit 9cea90e6cc
9 changed files with 27 additions and 27 deletions
+2 -2
View File
@@ -653,7 +653,7 @@ class TestBulkPushRuleEvaluator(HomeserverTestCase):
class TestKnockPushRules(HomeserverTestCase):
"""Tests for the MSCxxxx knock push rule (`.org.matrix.mscxxxx.rule.knock`
"""Tests for the MSC4506 knock push rule (`.org.matrix.msc4506.rule.knock`
with the `recipient_permission` condition): a knock should notify exactly
the members of the room whose power level lets them act on it.
"""
@@ -714,7 +714,7 @@ class TestKnockPushRules(HomeserverTestCase):
)
@override_config(
{"experimental_features": {"mscxxxx_knock_push_rule_enabled": True}}
{"experimental_features": {"msc4506_enabled": True}}
)
def test_knock_notifies_only_users_who_can_act(self) -> None:
knock_event_id = self._knock_and_get_event_id()
+3 -3
View File
@@ -824,14 +824,14 @@ class PushRuleEvaluatorTestCase(unittest.TestCase):
def test_recipient_permission(self) -> None:
"""
Test the MSCxxxx `recipient_permission` condition (knock push rules).
Test the MSC4506 `recipient_permission` condition (knock push rules).
"""
evaluator = self._get_evaluator(
{"membership": "knock"},
action_power_levels={"invite": 50},
)
condition = {
"kind": "org.matrix.mscxxxx.recipient_permission",
"kind": "org.matrix.msc4506.recipient_permission",
"key": "invite",
}
@@ -854,7 +854,7 @@ class PushRuleEvaluatorTestCase(unittest.TestCase):
# An action key with no known level never matches.
self.assertFalse(
evaluator.matches(
{"kind": "org.matrix.mscxxxx.recipient_permission", "key": "nonsense"},
{"kind": "org.matrix.msc4506.recipient_permission", "key": "nonsense"},
"@user:test",
None,
recipient_power_level=100,