mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 04:12:50 +02:00
Support m->d redacting messages and reactions
This commit is contained in:
parent
2e68c7edf5
commit
8d3ac665c9
7 changed files with 74 additions and 2 deletions
|
@ -12,6 +12,8 @@ const {discord, db, sync, as} = require("../passthrough")
|
|||
const sendEvent = sync.require("./actions/send-event")
|
||||
/** @type {import("./actions/add-reaction")} */
|
||||
const addReaction = sync.require("./actions/add-reaction")
|
||||
/** @type {import("./actions/redact")} */
|
||||
const redact = sync.require("./actions/redact")
|
||||
/** @type {import("./converters/utils")} */
|
||||
const utils = sync.require("./converters/utils")
|
||||
/** @type {import("../matrix/api")}) */
|
||||
|
@ -101,6 +103,15 @@ async event => {
|
|||
}
|
||||
}))
|
||||
|
||||
sync.addTemporaryListener(as, "type:m.room.redaction", guard("m.room.redaction",
|
||||
/**
|
||||
* @param {Ty.Event.Outer_M_Room_Redaction} event it is a m.room.redaction because that's what this listener is filtering for
|
||||
*/
|
||||
async event => {
|
||||
if (utils.eventSenderIsFromDiscord(event.sender)) return
|
||||
await redact.handle(event)
|
||||
}))
|
||||
|
||||
sync.addTemporaryListener(as, "type:m.room.avatar", guard("m.room.avatar",
|
||||
/**
|
||||
* @param {Ty.Event.StateOuter<Ty.Event.M_Room_Avatar>} event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue