fix: restore accidentally removed calls to updateLocalRecipients and saveAttachments

This commit is contained in:
Julian Lam
2024-03-15 16:38:00 -04:00
parent c76d4018f2
commit 5f60f75f7d

View File

@@ -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,7 +204,8 @@ Notes.assertTopic = async (uid, id) => {
tags.length = maxTags; tags.length = maxTags;
} }
await topics.post({ await Promise.all([
topics.post({
tid, tid,
uid: authorId, uid: authorId,
cid, cid,
@@ -213,14 +215,23 @@ Notes.assertTopic = async (uid, id) => {
tags, tags,
content: mainPost.content, content: mainPost.content,
_activitypub: mainPost._activitypub, _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);