mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: additional fixes re: 3780fdc6ff
This commit is contained in:
@@ -211,13 +211,14 @@ inbox.delete = async (req) => {
|
|||||||
throw new Error('[[error:activitypub.origin-mismatch]]');
|
throw new Error('[[error:activitypub.origin-mismatch]]');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const objectHostname = new URL(object.id || object).hostname;
|
const pid = object.id || object;
|
||||||
|
const objectHostname = new URL(pid).hostname;
|
||||||
if (actorHostname !== objectHostname) {
|
if (actorHostname !== objectHostname) {
|
||||||
throw new Error('[[error:activitypub.origin-mismatch]]');
|
throw new Error('[[error:activitypub.origin-mismatch]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
const [isNote/* , isActor */] = await Promise.all([
|
const [isNote/* , isActor */] = await Promise.all([
|
||||||
posts.exists(object),
|
posts.exists(pid),
|
||||||
// db.isSortedSetMember('usersRemote:lastCrawled', object.id),
|
// db.isSortedSetMember('usersRemote:lastCrawled', object.id),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ inbox.delete = async (req) => {
|
|||||||
case isNote: {
|
case isNote: {
|
||||||
const uid = await posts.getPostField(object, 'uid');
|
const uid = await posts.getPostField(object, 'uid');
|
||||||
await announce(object, req.body);
|
await announce(object, req.body);
|
||||||
await api.posts[method]({ uid }, { pid: object });
|
await api.posts[method]({ uid }, { pid });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +236,7 @@ inbox.delete = async (req) => {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
activitypub.helpers.log(`[activitypub/inbox.delete] Object (${object.id || object}) does not exist locally. Doing nothing.`);
|
activitypub.helpers.log(`[activitypub/inbox.delete] Object (${pid}) does not exist locally. Doing nothing.`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user