mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
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.
This commit is contained in:
parent
9bfc8bf752
commit
4ffac34a64
2 changed files with 6 additions and 4 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue