mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-08 19:21:33 -07:00
fix replacements crashing on delivering poll votes
Some checks failed
/ test-build (push) Has been cancelled
Some checks failed
/ test-build (push) Has been cancelled
This commit is contained in:
parent
4bc55eb6c9
commit
ebe2ff0e21
1 changed files with 20 additions and 18 deletions
|
@ -36,24 +36,26 @@ export default async (job: Bull.Job<DeliverJobData>) => {
|
||||||
logger.debug(`delivering ${latest}`);
|
logger.debug(`delivering ${latest}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let i = undefined;
|
let i = undefined;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
["Create", "Update"].includes(job.data.content.type)
|
["Create", "Update"].includes(job.data.content.type)
|
||||||
&& job.data.content.object.type === "Note"
|
&& job.data.content.object.type === "Note"
|
||||||
) {
|
&& job.data.content.object.content
|
||||||
const obj = job.data.content.object;
|
) {
|
||||||
const patchSrcContent = shouldPatchText(obj.source.content);
|
const obj = job.data.content.object;
|
||||||
if (patchSrcContent) {
|
const patchSrcContent = shouldPatchText(obj.source.content);
|
||||||
i = await registerOrFetchInstanceDoc(host);
|
if (patchSrcContent) {
|
||||||
if (shouldPatchText(obj.content))
|
i = await registerOrFetchInstanceDoc(host);
|
||||||
obj.content = patchText(obj.content, i);
|
if (shouldPatchText(obj.content))
|
||||||
if (shouldPatchText(obj._misskey_content))
|
obj.content = patchText(obj.content, i);
|
||||||
obj._misskey_content = patchText(obj._misskey_content, i);
|
if (shouldPatchText(obj._misskey_content))
|
||||||
if (patchSrcContent)
|
obj._misskey_content = patchText(obj._misskey_content, i);
|
||||||
obj.source.content = patchText(obj.source.content, i);
|
if (patchSrcContent)
|
||||||
}
|
obj.source.content = patchText(obj.source.content, i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await request(job.data.user, job.data.to, job.data.content);
|
await request(job.data.user, job.data.to, job.data.content);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue