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

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Oct 6, 2022
1 parent 1bdfd61 commit 3d951e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion synapse/push/bulk_push_rule_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,18 @@ async def action_for_event_by_user(
if relation.rel_type == RelationTypes.THREAD:
thread_id = relation.parent_id

# It's possible that old room versions have non-integer power levels (floats or
# strings). Workaround this by explicitly converting to int.
notification_levels = power_levels.get("notifications", {})
if not event.room_version.msc3667_int_only_power_levels:
for user_id, level in notification_levels.items():
notification_levels[user_id] = int(level)

evaluator = PushRuleEvaluator(
_flatten_dict(event),
room_member_count,
sender_power_level,
power_levels.get("notifications", {}),
notification_levels,
relations,
self._relations_match_enabled,
)
Expand Down

0 comments on commit 3d951e6

Please sign in to comment.