Compare commits
No commits in common. "33ec4a9bea2fdc39f4621bdbee4a9b86b8b8eb07" and "c298f78f96e631d45cd84a268dce2db1cd69747b" have entirely different histories.
33ec4a9bea
...
c298f78f96
1 changed files with 19 additions and 24 deletions
|
|
@ -8,7 +8,6 @@ const util = require("util")
|
||||||
const Ty = require("../types")
|
const Ty = require("../types")
|
||||||
const {discord, db, sync, as, select} = require("../passthrough")
|
const {discord, db, sync, as, select} = require("../passthrough")
|
||||||
const {tag} = require("@cloudrac3r/html-template-tag")
|
const {tag} = require("@cloudrac3r/html-template-tag")
|
||||||
const {Semaphore} = require("@chriscdn/promise-semaphore")
|
|
||||||
|
|
||||||
/** @type {import("./actions/send-event")} */
|
/** @type {import("./actions/send-event")} */
|
||||||
const sendEvent = sync.require("./actions/send-event")
|
const sendEvent = sync.require("./actions/send-event")
|
||||||
|
|
@ -154,14 +153,11 @@ function guard(type, fn) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const errorRetrySema = new Semaphore()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Ty.Event.Outer<Ty.Event.M_Reaction>} reactionEvent
|
* @param {Ty.Event.Outer<Ty.Event.M_Reaction>} reactionEvent
|
||||||
*/
|
*/
|
||||||
async function onRetryReactionAdd(reactionEvent) {
|
async function onRetryReactionAdd(reactionEvent) {
|
||||||
const roomID = reactionEvent.room_id
|
const roomID = reactionEvent.room_id
|
||||||
errorRetrySema.request(async () => {
|
|
||||||
const event = await api.getEvent(roomID, reactionEvent.content["m.relates_to"]?.event_id)
|
const event = await api.getEvent(roomID, reactionEvent.content["m.relates_to"]?.event_id)
|
||||||
|
|
||||||
// Check that it's a real error from OOYE
|
// Check that it's a real error from OOYE
|
||||||
|
|
@ -185,7 +181,6 @@ async function onRetryReactionAdd(reactionEvent) {
|
||||||
|
|
||||||
// Redact the error to stop people from executing multiple retries
|
// Redact the error to stop people from executing multiple retries
|
||||||
await api.redactEvent(roomID, event.event_id)
|
await api.redactEvent(roomID, event.event_id)
|
||||||
}, roomID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sync.addTemporaryListener(as, "type:m.room.message", guard("m.room.message",
|
sync.addTemporaryListener(as, "type:m.room.message", guard("m.room.message",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue