fix(edit): tweak note update to

This commit is contained in:
Nya Candy 2024-01-26 12:50:35 +08:00 committed by fly_mc
parent 5e322e52f3
commit 728c8c6eb8

View file

@ -594,15 +594,19 @@ export class ApRendererService {
} }
@bindThis @bindThis
public renderUpdateNote(object: string | IPost, note: { id: MiNote['id'], userId: MiNote['userId'] }): IUpdate { public renderUpdateNote(object: IPost, note: { id: MiNote['id'], userId: MiNote['userId'] }): IUpdate {
return { const activity: IUpdate = {
id: `${this.config.url}/notes/${note.id}#updates/${new Date().getTime()}`, id: `${this.config.url}/notes/${note.id}#updates/${new Date().getTime()}`,
actor: this.userEntityService.genLocalUserUri(note.userId), actor: this.userEntityService.genLocalUserUri(note.userId),
type: 'Update', type: 'Update',
to: ['https://www.w3.org/ns/activitystreams#Public'],
object,
published: new Date().toISOString(), published: new Date().toISOString(),
object,
}; };
if (object.to) activity.to = object.to;
if (object.cc) activity.cc = object.cc;
return activity;
} }
@bindThis @bindThis