mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Use static for const dicts
This commit is contained in:
parent
0e39dcd135
commit
d1f56f732e
4 changed files with 209 additions and 198 deletions
|
@ -126,7 +126,7 @@ class PushRuleRestServlet(ClientV1RestServlet):
|
|||
rule["actions"] = json.loads(rawrule["actions"])
|
||||
ruleslist.append(rule)
|
||||
|
||||
ruleslist = baserules.list_with_base_rules(ruleslist, user)
|
||||
ruleslist = baserules.list_with_base_rules(ruleslist)
|
||||
|
||||
rules = {'global': {}, 'device': {}}
|
||||
|
||||
|
@ -144,6 +144,12 @@ class PushRuleRestServlet(ClientV1RestServlet):
|
|||
for c in r["conditions"]:
|
||||
c.pop("_id", None)
|
||||
|
||||
pattern_type = c.pop("pattern_type", None)
|
||||
if pattern_type == "user_id":
|
||||
c["pattern"] = user.to_string()
|
||||
elif pattern_type == "user_localpart":
|
||||
c["pattern"] = user.localpart
|
||||
|
||||
if r['priority_class'] > PRIORITY_CLASS_MAP['override']:
|
||||
# per-device rule
|
||||
profile_tag = _profile_tag_from_conditions(r["conditions"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue