mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: restrict feps methods to real cids
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
const winston = require('winston');
|
|
||||||
|
|
||||||
const posts = require('../posts');
|
const posts = require('../posts');
|
||||||
|
|
||||||
@@ -14,6 +13,9 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
({ id: localId } = await activitypub.helpers.resolveLocalId(id));
|
({ id: localId } = await activitypub.helpers.resolveLocalId(id));
|
||||||
}
|
}
|
||||||
const cid = await posts.getCidByPid(localId || id);
|
const cid = await posts.getCidByPid(localId || id);
|
||||||
|
if (cid === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
||||||
if (!followers.length) {
|
if (!followers.length) {
|
||||||
@@ -44,6 +46,9 @@ Feps.announceObject = async function announceObject(id) {
|
|||||||
({ id: localId } = await activitypub.helpers.resolveLocalId(id));
|
({ id: localId } = await activitypub.helpers.resolveLocalId(id));
|
||||||
}
|
}
|
||||||
const cid = await posts.getCidByPid(localId || id);
|
const cid = await posts.getCidByPid(localId || id);
|
||||||
|
if (cid === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
||||||
if (!followers.length) {
|
if (!followers.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user