mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 20:32:50 +02:00
Fix speedbump in threads
This commit is contained in:
parent
0f25e73d67
commit
0e701b2d54
4 changed files with 28 additions and 17 deletions
|
@ -11,7 +11,7 @@ const speedbump = sync.require("./speedbump")
|
|||
* @param {import("discord-api-types/v10").GatewayMessageDeleteDispatchData} data
|
||||
*/
|
||||
async function deleteMessage(data) {
|
||||
const row = select("channel_room", ["room_id", "speedbump_checked"], {channel_id: data.channel_id}).get()
|
||||
const row = select("channel_room", ["room_id", "speedbump_checked", "thread_parent"], {channel_id: data.channel_id}).get()
|
||||
if (!row) return
|
||||
|
||||
const eventsToRedact = select("event_message", "event_id", {message_id: data.id}).pluck().all()
|
||||
|
@ -22,7 +22,7 @@ async function deleteMessage(data) {
|
|||
await api.redactEvent(row.room_id, eventID)
|
||||
}
|
||||
|
||||
speedbump.updateCache(data.channel_id, row.speedbump_checked)
|
||||
await speedbump.updateCache(row.thread_parent || data.channel_id, row.speedbump_checked)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue