From 728c8c6eb8fa0d52f99362ba3b1d14a63590c19a Mon Sep 17 00:00:00 2001 From: Nya Candy Date: Fri, 26 Jan 2024 12:50:35 +0800 Subject: [PATCH] fix(edit): tweak note update to --- .../src/core/activitypub/ApRendererService.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 72945c43d..0d5687a11 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -594,15 +594,19 @@ export class ApRendererService { } @bindThis - public renderUpdateNote(object: string | IPost, note: { id: MiNote['id'], userId: MiNote['userId'] }): IUpdate { - return { + public renderUpdateNote(object: IPost, note: { id: MiNote['id'], userId: MiNote['userId'] }): IUpdate { + const activity: IUpdate = { id: `${this.config.url}/notes/${note.id}#updates/${new Date().getTime()}`, actor: this.userEntityService.genLocalUserUri(note.userId), type: 'Update', - to: ['https://www.w3.org/ns/activitystreams#Public'], - object, published: new Date().toISOString(), + object, }; + + if (object.to) activity.to = object.to; + if (object.cc) activity.cc = object.cc; + + return activity; } @bindThis