From ba9563b983921e53f9db165b8657301a65afa1b0 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:39:00 +0900 Subject: [PATCH] Use unique id for Undo (#8434) --- packages/backend/src/remote/activitypub/renderer/undo.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/remote/activitypub/renderer/undo.ts b/packages/backend/src/remote/activitypub/renderer/undo.ts index d28778e22e..46631df9ea 100644 --- a/packages/backend/src/remote/activitypub/renderer/undo.ts +++ b/packages/backend/src/remote/activitypub/renderer/undo.ts @@ -3,9 +3,11 @@ import { ILocalUser, User } from '@/models/entities/user.js'; export default (object: any, user: { id: User['id'] }) => { if (object == null) return null; + const id = typeof object.id === 'string' && object.id.startsWith(config.url) ? `${object.id}/undo` : undefined; return { type: 'Undo', + ...(id ? { id } : {}), actor: `${config.url}/users/${user.id}`, object, published: new Date().toISOString(),