diff --git a/docs/notes.md b/docs/notes.md index 4ed8dc5..3e2607f 100644 --- a/docs/notes.md +++ b/docs/notes.md @@ -2,11 +2,7 @@ ## Known issues -- d->m emojis do not work at all (inline chat, single emoji size, reactions, bridged state) -- d->m embeds - m->d code blocks have slightly too much spacing -- m->d deletions -- removing reactions - rooms will be set up even if the bridge does not have permission for the channels, which breaks when it restarts and tries to fetch messages - test private threads as part of this - solution part 1: calculate the permissions to see if the bot should be able to do stuff diff --git a/m2d/actions/redact.js b/m2d/actions/redact.js index e2d9ece..74b92b8 100644 --- a/m2d/actions/redact.js +++ b/m2d/actions/redact.js @@ -12,9 +12,10 @@ const utils = sync.require("../converters/utils") * @param {Ty.Event.Outer_M_Room_Redaction} event */ async function deleteMessage(event) { - const row = from("event_message").join("message_channel", "message_id").select("channel_id", "message_id").and("WHERE event_id = ?").get(event.event_id) - if (!row) return - return discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason) + const rows = from("event_message").join("message_channel", "message_id").select("channel_id", "message_id").and("WHERE event_id = ?").all(event.redacts) + for (const row of rows) { + discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason) + } } /**