mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: remove duplicate 1b12 announce in notes.assert (already handled in inbox)
This commit is contained in:
@@ -33,9 +33,11 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
* retrieving the entire reply tree is not possible at this time.
|
* retrieving the entire reply tree is not possible at this time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const object = !activitypub.helpers.isUri(input) && input;
|
if (!input) {
|
||||||
const id = object ? object.id : input;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const id = !activitypub.helpers.isUri(input) ? input.id : input;
|
||||||
const lockStatus = await lock(id, '[[error:activitypub.already-asserting]]');
|
const lockStatus = await lock(id, '[[error:activitypub.already-asserting]]');
|
||||||
if (!lockStatus) { // unable to achieve lock, stop processing.
|
if (!lockStatus) { // unable to achieve lock, stop processing.
|
||||||
return null;
|
return null;
|
||||||
@@ -153,8 +155,6 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
unprocessed.pop();
|
unprocessed.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
const cidFollowers = await activitypub.notes.getCategoryFollowers(cid);
|
|
||||||
|
|
||||||
unprocessed.reverse();
|
unprocessed.reverse();
|
||||||
for (const post of unprocessed) {
|
for (const post of unprocessed) {
|
||||||
const { to, cc, attachment } = post._activitypub;
|
const { to, cc, attachment } = post._activitypub;
|
||||||
@@ -165,17 +165,6 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
Notes.updateLocalRecipients(post.pid, { to, cc }),
|
Notes.updateLocalRecipients(post.pid, { to, cc }),
|
||||||
posts.attachments.update(post.pid, attachment),
|
posts.attachments.update(post.pid, attachment),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Category announce
|
|
||||||
if (cidFollowers.length && object && object.id === post.pid) {
|
|
||||||
activitypub.send('cid', cid, cidFollowers, {
|
|
||||||
id: `${object.id}#activity/announce/${Date.now()}`,
|
|
||||||
type: 'Announce',
|
|
||||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
|
||||||
cc: [activitypub._constants.publicAddress],
|
|
||||||
object,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user