update monkey patch to matrix 1.84.1

This commit is contained in:
HF 2023-05-30 16:20:35 +02:00
parent 7b634951d2
commit d1b45f822f
1 changed files with 4 additions and 4 deletions

View File

@ -21,11 +21,11 @@ def monkeyPatchPushRules(store):
otherwise event_push_actions will get filled up with unread
notification for pp_ users, creating and infinite growing database
"""
originalFunction = BulkPushRuleEvaluator.action_for_event_by_user
originalFunction = BulkPushRuleEvaluator._action_for_event_by_user
# cache for whether room is bridge room that gets notifications blocked or not
room_block_notif = {}
async def monkeyPatch(self, event, context):
async def monkeyPatch(self, event, context, event_id_to_event):
# always notify on invites
if event.type != EventTypes.Member or event.membership != Membership.INVITE:
room_id = event.room_id
@ -39,9 +39,9 @@ def monkeyPatchPushRules(store):
room_block_notif[room_id] = True
return
room_block_notif[room_id] = False
return await originalFunction(self, event, context)
return await originalFunction(self, event, context, event_id_to_event)
BulkPushRuleEvaluator.action_for_event_by_user = monkeyPatch
BulkPushRuleEvaluator._action_for_event_by_user = monkeyPatch
logger.info('Monkey patched BulkPushRuleEvaluator')