feat: send unique identifiers for note activities

This commit is contained in:
Opliko
2024-04-06 01:50:39 +02:00
parent 8003b00acd
commit 9fc194e3a8
2 changed files with 4 additions and 1 deletions

View File

@@ -109,12 +109,14 @@ activitypubApi.create.post = enabledCheck(async (caller, { pid }) => {
const payloads = {
create: {
id: `${object.id}#create`,
type: 'Create',
to: object.to,
cc: object.cc,
object,
},
announce: {
id: `${object.id}#announce`,
type: 'Announce',
to: [`${nconf.get('url')}/category/${cid}/followers`],
cc: [activitypub._constants.publicAddress],
@@ -155,6 +157,7 @@ activitypubApi.update.note = enabledCheck(async (caller, { post }) => {
}
const payload = {
id: `${object.id}#update/${post.edited}`,
type: 'Update',
to: object.to,
cc: object.cc,

View File

@@ -134,7 +134,7 @@ postsAPI.edit = async function (caller, data) {
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 };
returnData.topic = { ...postObj[0].topic, ...editResult.post.topic };