mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: send unique identifiers for note activities
This commit is contained in:
@@ -109,12 +109,14 @@ activitypubApi.create.post = enabledCheck(async (caller, { pid }) => {
|
|||||||
|
|
||||||
const payloads = {
|
const payloads = {
|
||||||
create: {
|
create: {
|
||||||
|
id: `${object.id}#create`,
|
||||||
type: 'Create',
|
type: 'Create',
|
||||||
to: object.to,
|
to: object.to,
|
||||||
cc: object.cc,
|
cc: object.cc,
|
||||||
object,
|
object,
|
||||||
},
|
},
|
||||||
announce: {
|
announce: {
|
||||||
|
id: `${object.id}#announce`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||||
cc: [activitypub._constants.publicAddress],
|
cc: [activitypub._constants.publicAddress],
|
||||||
@@ -155,6 +157,7 @@ activitypubApi.update.note = enabledCheck(async (caller, { post }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
|
id: `${object.id}#update/${post.edited}`,
|
||||||
type: 'Update',
|
type: 'Update',
|
||||||
to: object.to,
|
to: object.to,
|
||||||
cc: object.cc,
|
cc: object.cc,
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ postsAPI.edit = async function (caller, data) {
|
|||||||
newTitle: validator.escape(String(editResult.topic.title)),
|
newTitle: validator.escape(String(editResult.topic.title)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const postObj = await posts.getPostSummaryByPids([editResult.post.pid], caller.uid, {});
|
const postObj = await posts.getPostSummaryByPids([editResult.post.pid], caller.uid, { extraFields: ['edited']});
|
||||||
const returnData = { ...postObj[0], ...editResult.post };
|
const returnData = { ...postObj[0], ...editResult.post };
|
||||||
returnData.topic = { ...postObj[0].topic, ...editResult.post.topic };
|
returnData.topic = { ...postObj[0].topic, ...editResult.post.topic };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user