mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Delete notifications for redacted events
This commit is contained in:
parent
ae1262a241
commit
992928304f
@ -19,6 +19,8 @@ import bulk_push_rule_evaluator
|
||||
|
||||
import logging
|
||||
|
||||
from synapse.api.constants import EventTypes
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -34,6 +36,11 @@ class ActionGenerator:
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def handle_push_actions_for_event(self, event, handler):
|
||||
if event.type == EventTypes.Redaction and event.redacts is not None:
|
||||
yield self.store.remove_push_actions_for_event_id(
|
||||
event.room_id, event.redacts
|
||||
)
|
||||
|
||||
bulk_evaluator = yield bulk_push_rule_evaluator.evaluator_for_room_id(
|
||||
event.room_id, self.store
|
||||
)
|
||||
|
@ -93,6 +93,18 @@ class EventPushActionsStore(SQLBaseStore):
|
||||
)
|
||||
defer.returnValue(ret)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def remove_push_actions_for_event_id(self, room_id, event_id):
|
||||
def f(txn):
|
||||
txn.execute(
|
||||
"DELETE FROM event_push_actions WHERE room_id = ? AND event_id = ?",
|
||||
(room_id, event_id)
|
||||
)
|
||||
yield self.runInteraction(
|
||||
"remove_push_actions_for_event_id",
|
||||
f
|
||||
)
|
||||
|
||||
|
||||
class EventPushActionsTable(object):
|
||||
table_name = "event_push_actions"
|
||||
|
Loading…
Reference in New Issue
Block a user