diff --git a/src/remote/activitypub/renderer/undo.ts b/src/remote/activitypub/renderer/undo.ts index 2ff6b61b90..27f46039b2 100644 --- a/src/remote/activitypub/renderer/undo.ts +++ b/src/remote/activitypub/renderer/undo.ts @@ -1,8 +1,12 @@ import config from '../../../config'; import { ILocalUser, User } from '../../../models/entities/user'; -export default (object: any, user: ILocalUser | User) => ({ - type: 'Undo', - actor: `${config.url}/users/${user.id}`, - object -}); +export default (object: any, user: ILocalUser | User) => { + if (object == null) return null; + + return { + type: 'Undo', + actor: `${config.url}/users/${user.id}`, + object + }; +}; diff --git a/src/services/note/delete.ts b/src/services/note/delete.ts index 3bdf4b3ccc..da32606f63 100644 --- a/src/services/note/delete.ts +++ b/src/services/note/delete.ts @@ -35,7 +35,7 @@ export default async function(user: User, note: Note, quiet = false) { }); //#region ローカルの投稿なら削除アクティビティを配送 - if (Users.isLocalUser(user)) { + if (Users.isLocalUser(user) && !note.localOnly) { let renote: Note | undefined; // if deletd note is renote