Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't ignore set_tweak actions with no explicit value. #7766

Merged
merged 4 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7766.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix to not ignore `set_tweak` actions in Push Rules that have no `value`, as permitted by the specification.
6 changes: 4 additions & 2 deletions synapse/push/push_rule_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ def tweaks_for_actions(actions):
for a in actions:
if not isinstance(a, dict):
continue
if "set_tweak" in a and "value" in a:
tweaks[a["set_tweak"]] = a["value"]
if "set_tweak" in a:
# value is allowed to be absent in which case the value assumed
# should be True.
tweaks[a["set_tweak"]] = a.get("value", True)
return tweaks


Expand Down