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

Commit 0285120

Browse files
committed
Use unstable prefixes.
1 parent 4b0f979 commit 0285120

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

synapse/push/baserules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,10 @@ def make_base_prepend_rules(
353353
],
354354
},
355355
{
356-
"rule_id": "global/underride/.m.rule.thread_reply",
356+
"rule_id": "global/underride/.org.matrix.msc3772.thread_reply",
357357
"conditions": [
358358
{
359-
"kind": "relation_match",
359+
"kind": "org.matrix.msc3772.relation_match",
360360
"rel_type": "m.thread",
361361
# Match the requester's MXID.
362362
"sender_type": "user_id",

synapse/push/push_rule_evaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def matches(
190190
return _sender_notification_permission(
191191
self._event, condition, self._sender_power_level, self._power_levels
192192
)
193-
elif condition["kind"] == "relation_match":
193+
elif condition["kind"] == "org.matrix.msc3772.relation_match":
194194
return self._relation_match(condition, user_id)
195195
else:
196196
return True

tests/push/test_push_rule_evaluator.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,37 +289,46 @@ def test_relations(self) -> None:
289289
)
290290

291291
# Check just relation type.
292-
condition = {"kind": "relation_match", "rel_type": "m.annotation"}
292+
condition = {
293+
"kind": "org.matrix.msc3772.relation_match",
294+
"rel_type": "m.annotation",
295+
}
293296
self.assertTrue(evaluator.matches(condition, "@user:test", "foo"))
294297

295298
# Check relation type and sender.
296299
condition = {
297-
"kind": "relation_match",
300+
"kind": "org.matrix.msc3772.relation_match",
298301
"rel_type": "m.annotation",
299302
"sender": "@user:test",
300303
}
301304
self.assertTrue(evaluator.matches(condition, "@user:test", "foo"))
302305
condition = {
303-
"kind": "relation_match",
306+
"kind": "org.matrix.msc3772.relation_match",
304307
"rel_type": "m.annotation",
305308
"sender": "@other:test",
306309
}
307310
self.assertFalse(evaluator.matches(condition, "@user:test", "foo"))
308311

309312
# Check relation type and event type.
310313
condition = {
311-
"kind": "relation_match",
314+
"kind": "org.matrix.msc3772.relation_match",
312315
"rel_type": "m.annotation",
313316
"type": "m.reaction",
314317
}
315318
self.assertTrue(evaluator.matches(condition, "@user:test", "foo"))
316319

317320
# Check just sender.
318-
condition = {"kind": "relation_match", "sender": "@user:test"}
321+
condition = {
322+
"kind": "org.matrix.msc3772.relation_match",
323+
"sender": "@user:test",
324+
}
319325
self.assertTrue(evaluator.matches(condition, "@user:test", "foo"))
320-
condition = {"kind": "relation_match", "sender": "@other:test"}
326+
condition = {
327+
"kind": "org.matrix.msc3772.relation_match",
328+
"sender": "@other:test",
329+
}
321330
self.assertFalse(evaluator.matches(condition, "@user:test", "foo"))
322331

323332
# Check glob.
324-
condition = {"kind": "relation_match", "sender": "@*:test"}
333+
condition = {"kind": "org.matrix.msc3772.relation_match", "sender": "@*:test"}
325334
self.assertTrue(evaluator.matches(condition, "@user:test", "foo"))

0 commit comments

Comments
 (0)