forked from cadence/out-of-your-element
Forget messages/events upon deletion (may fix #18)
This commit is contained in:
parent
84d791cd8a
commit
8e3b674d90
3 changed files with 6 additions and 1 deletions
|
@ -13,10 +13,11 @@ async function deleteMessage(data) {
|
|||
if (!roomID) return
|
||||
|
||||
const eventsToRedact = select("event_message", "event_id", {message_id: data.id}).pluck().all()
|
||||
db.prepare("DELETE FROM message_channel WHERE message_id = ?").run(data.id)
|
||||
db.prepare("DELETE FROM event_message WHERE message_id = ?").run(data.id)
|
||||
for (const eventID of eventsToRedact) {
|
||||
// Unfortunately, we can't specify a sender to do the redaction as, unless we find out that info via the audit logs
|
||||
await api.redactEvent(roomID, eventID)
|
||||
db.prepare("DELETE FROM event_message WHERE event_id = ?").run(eventID)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue