mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 01:21:13 +01:00
fix: unable to process Update(Person)
This commit is contained in:
@@ -38,20 +38,20 @@ inbox.update = async (req) => {
|
|||||||
throw new Error('[[error:activitypub.origin-mismatch]]');
|
throw new Error('[[error:activitypub.origin-mismatch]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
const [exists, allowed] = await Promise.all([
|
|
||||||
posts.exists(object.id),
|
|
||||||
privileges.posts.can('posts:edit', object.id, activitypub._constants.uid),
|
|
||||||
]);
|
|
||||||
if (!exists || !allowed) {
|
|
||||||
winston.info(`[activitypub/inbox.update] ${object.id} not allowed to be edited.`);
|
|
||||||
return activitypub.send('uid', 0, actor, {
|
|
||||||
type: 'Reject',
|
|
||||||
object,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (object.type) {
|
switch (object.type) {
|
||||||
case 'Note': {
|
case 'Note': {
|
||||||
|
const [exists, allowed] = await Promise.all([
|
||||||
|
posts.exists(object.id),
|
||||||
|
privileges.posts.can('posts:edit', object.id, activitypub._constants.uid),
|
||||||
|
]);
|
||||||
|
if (!exists || !allowed) {
|
||||||
|
winston.info(`[activitypub/inbox.update] ${object.id} not allowed to be edited.`);
|
||||||
|
return activitypub.send('uid', 0, actor, {
|
||||||
|
type: 'Reject',
|
||||||
|
object,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const postData = await activitypub.mocks.post(object);
|
const postData = await activitypub.mocks.post(object);
|
||||||
|
|
||||||
if (postData) {
|
if (postData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user