mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: resolve toPid to local pid if able
This commit is contained in:
@@ -82,7 +82,7 @@ Mocks.post = async (objects) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
let {
|
||||||
id: pid,
|
id: pid,
|
||||||
attributedTo: uid,
|
attributedTo: uid,
|
||||||
inReplyTo: toPid,
|
inReplyTo: toPid,
|
||||||
@@ -91,6 +91,10 @@ Mocks.post = async (objects) => {
|
|||||||
// conversation, // mastodon-specific, ignored.
|
// conversation, // mastodon-specific, ignored.
|
||||||
} = object;
|
} = object;
|
||||||
|
|
||||||
|
const resolved = await activitypub.helpers.resolveLocalId(toPid);
|
||||||
|
if (resolved.type === 'post') {
|
||||||
|
toPid = resolved.id;
|
||||||
|
}
|
||||||
const timestamp = new Date(published).getTime();
|
const timestamp = new Date(published).getTime();
|
||||||
let edited = new Date(updated);
|
let edited = new Date(updated);
|
||||||
edited = Number.isNaN(edited.valueOf()) ? undefined : edited;
|
edited = Number.isNaN(edited.valueOf()) ? undefined : edited;
|
||||||
|
|||||||
Reference in New Issue
Block a user