summary refs log tree commit diff
path: root/synapse/push/__init__.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2015-02-09 16:44:47 +0000
committerMatthew Hodgson <matthew@matrix.org>2015-02-09 16:44:47 +0000
commita578251b4800f20424e8b294a42cc6c65ef568a2 (patch)
tree6c9d3303261b6f43af6690299b1f3259399db4b5 /synapse/push/__init__.py
parentMerge pull request #55 from matrix-org/profiling (diff)
downloadsynapse-a578251b4800f20424e8b294a42cc6c65ef568a2.tar.xz
only do word-boundary patches on bodies for now
Diffstat (limited to 'synapse/push/__init__.py')
-rw-r--r--synapse/push/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py
index 07b5f0187c..58c8cf700b 100644
--- a/synapse/push/__init__.py
+++ b/synapse/push/__init__.py
@@ -147,7 +147,10 @@ class Pusher(object):
                 logger.warn("event_match condition with no pattern")
                 return False
             # XXX: optimisation: cache our pattern regexps
-            r = r'\b%s\b' % self._glob_to_regexp(condition['pattern'])
+            if condition['key'] == 'content.body':
+                r = r'\b%s\b' % self._glob_to_regexp(condition['pattern'])
+            else:
+                r = r'^%s$' % self._glob_to_regexp(condition['pattern'])
             val = _value_for_dotted_key(condition['key'], ev)
             if val is None:
                 return False