summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-12-10 20:08:38 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2021-12-10 20:08:38 +0000
commit30469893aa35992401a02280ca2a41389aa8aa72 (patch)
tree2991f64d5507a7ed78341c6bc8e5fb6f99b91ad5 /synapse/push
parentstore argument is no longer optional in is_interested_in_room (diff)
parentUpdate tests to enable experimental features (diff)
downloadsynapse-github/anoa/e2e_as_internal_testing.tar.xz
Merge branch 'rei/as_device_masquerading_msc3202' of github.com:matrix-org/synapse into anoa/e2e_as_internal_testing github/anoa/e2e_as_internal_testing anoa/e2e_as_internal_testing
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/push_rule_evaluator.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py

index 659a53805d..7f68092ec5 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py
@@ -17,10 +17,9 @@ import logging import re from typing import Any, Dict, List, Optional, Pattern, Tuple, Union -from matrix_common.regex import glob_to_regex, to_word_pattern - from synapse.events import EventBase from synapse.types import JsonDict, UserID +from synapse.util import glob_to_regex, re_word_boundary from synapse.util.caches.lrucache import LruCache logger = logging.getLogger(__name__) @@ -185,7 +184,7 @@ class PushRuleEvaluatorForEvent: r = regex_cache.get((display_name, False, True), None) if not r: r1 = re.escape(display_name) - r1 = to_word_pattern(r1) + r1 = re_word_boundary(r1) r = re.compile(r1, flags=re.IGNORECASE) regex_cache[(display_name, False, True)] = r @@ -214,7 +213,7 @@ def _glob_matches(glob: str, value: str, word_boundary: bool = False) -> bool: try: r = regex_cache.get((glob, True, word_boundary), None) if not r: - r = glob_to_regex(glob, word_boundary=word_boundary) + r = glob_to_regex(glob, word_boundary) regex_cache[(glob, True, word_boundary)] = r return bool(r.search(value)) except re.error: