diff options
author | David Baker <dave@matrix.org> | 2015-01-30 15:02:21 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-01-30 15:03:56 +0000 |
commit | 4ffac34a646fa2e763ba9214199d7803d1174959 (patch) | |
tree | b62b75f11bd1f62c5e83a41e9a24f3d5cd7ede4c /synapse/rest | |
parent | Merge pull request #40 from matrix-org/rejections_storage (diff) | |
download | synapse-4ffac34a646fa2e763ba9214199d7803d1174959.tar.xz |
Add glob asterisks when running rules.
Means that now you can't do exact matches even in override rules, but I think we can live with that. Advantage is that you'll now always get back what was put in to the API.
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/client/v1/push_rule.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py index 0f78fa667c..61e3bc8236 100644 --- a/synapse/rest/client/v1/push_rule.py +++ b/synapse/rest/client/v1/push_rule.py @@ -98,10 +98,7 @@ class PushRuleRestServlet(ClientV1RestServlet): if 'pattern' not in req_obj: raise InvalidRuleException("Content rule missing 'pattern'") pat = req_obj['pattern'] - if pat.strip("*?[]") == pat: - # no special glob characters so we assume the user means - # 'contains this string' rather than 'is this string' - pat = "*%s*" % (pat,) + conditions = [{ 'kind': 'event_match', 'key': 'content.body', |