This commit is contained in:
David Baker 2017-10-10 15:53:34 +01:00
parent ab1bc9bf5f
commit 81a5e0073c
2 changed files with 5 additions and 3 deletions

View File

@ -119,7 +119,7 @@ class BulkPushRuleEvaluator(object):
# fastpath: if there's a power level event, that's all we need, and # fastpath: if there's a power level event, that's all we need, and
# not having a power level event is an extreme edge case # not having a power level event is an extreme edge case
pl_event = yield self.store.get_event(pl_event_id) pl_event = yield self.store.get_event(pl_event_id)
auth_events = { POWER_KEY: pl_event } auth_events = {POWER_KEY: pl_event}
else: else:
auth_events_ids = yield self.auth.compute_auth_events( auth_events_ids = yield self.auth.compute_auth_events(
event, context.prev_state_ids, for_verification=False, event, context.prev_state_ids, for_verification=False,
@ -150,7 +150,9 @@ class BulkPushRuleEvaluator(object):
event, context event, context
) )
(power_levels, sender_power_level) = yield self._get_power_levels_and_sender_level(event, context) (power_levels, sender_power_level) = (
yield self._get_power_levels_and_sender_level(event, context)
)
evaluator = PushRuleEvaluatorForEvent( evaluator = PushRuleEvaluatorForEvent(
event, len(room_members), sender_power_level, power_levels, event, len(room_members), sender_power_level, power_levels,

View File

@ -41,7 +41,7 @@ def _sender_notification_permission(ev, condition, sender_power_level, power_lev
notif_levels = power_levels.get('notifications', {}) notif_levels = power_levels.get('notifications', {})
room_notif_level = notif_levels.get(notif_level_key, 50) room_notif_level = notif_levels.get(notif_level_key, 50)
return sender_power_level >= room_notif_level; return sender_power_level >= room_notif_level
def _test_ineq_condition(condition, number): def _test_ineq_condition(condition, number):