mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: restore accidentally removed calls to updateLocalRecipients and saveAttachments
This commit is contained in:
@@ -193,6 +193,7 @@ Notes.assertTopic = async (uid, id) => {
|
|||||||
|
|
||||||
let tags;
|
let tags;
|
||||||
if (!hasTid) {
|
if (!hasTid) {
|
||||||
|
const { to, cc, attachment } = mainPost._activitypub;
|
||||||
const systemTags = (meta.config.systemTags || '').split(',');
|
const systemTags = (meta.config.systemTags || '').split(',');
|
||||||
const maxTags = await categories.getCategoryField(cid, 'maxTags');
|
const maxTags = await categories.getCategoryField(cid, 'maxTags');
|
||||||
tags = (mainPost._activitypub.tag || [])
|
tags = (mainPost._activitypub.tag || [])
|
||||||
@@ -203,24 +204,34 @@ Notes.assertTopic = async (uid, id) => {
|
|||||||
tags.length = maxTags;
|
tags.length = maxTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
await topics.post({
|
await Promise.all([
|
||||||
tid,
|
topics.post({
|
||||||
uid: authorId,
|
tid,
|
||||||
cid,
|
uid: authorId,
|
||||||
pid: mainPid,
|
cid,
|
||||||
title,
|
pid: mainPid,
|
||||||
timestamp,
|
title,
|
||||||
tags,
|
timestamp,
|
||||||
content: mainPost.content,
|
tags,
|
||||||
_activitypub: mainPost._activitypub,
|
content: mainPost.content,
|
||||||
});
|
_activitypub: mainPost._activitypub,
|
||||||
|
}),
|
||||||
|
Notes.updateLocalRecipients(mainPid, { to, cc }),
|
||||||
|
Notes.saveAttachments(mainPid, attachment),
|
||||||
|
]);
|
||||||
unprocessed.pop();
|
unprocessed.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
unprocessed.reverse();
|
unprocessed.reverse();
|
||||||
for (const post of unprocessed) {
|
for (const post of unprocessed) {
|
||||||
|
const { to, cc, attachment } = post._activitypub;
|
||||||
|
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await topics.reply(post);
|
await Promise.all([
|
||||||
|
topics.reply(post),
|
||||||
|
Notes.updateLocalRecipients(post.pid, { to, cc }),
|
||||||
|
Notes.saveAttachments(post.pid, attachment),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Notes.syncUserInboxes(tid);
|
await Notes.syncUserInboxes(tid);
|
||||||
|
|||||||
Reference in New Issue
Block a user