From 63a2ef73f805476f7735eabe4fe02584f9dacf8a Mon Sep 17 00:00:00 2001 From: mei23 Date: Sat, 25 Aug 2018 14:46:47 +0900 Subject: [PATCH] Send actor in Undo Follow --- src/remote/activitypub/renderer/undo.ts | 6 +++++- src/services/following/delete.ts | 2 +- src/services/following/requests/cancel.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/remote/activitypub/renderer/undo.ts b/src/remote/activitypub/renderer/undo.ts index 4498409a5..bf90a3f28 100644 --- a/src/remote/activitypub/renderer/undo.ts +++ b/src/remote/activitypub/renderer/undo.ts @@ -1,4 +1,8 @@ -export default (object: any) => ({ +import config from '../../../config'; +import { ILocalUser, IUser } from "../../../models/user"; + +export default (object: any, user: ILocalUser | IUser) => ({ type: 'Undo', + actor: `${config.url}/users/${user._id}`, object }); diff --git a/src/services/following/delete.ts b/src/services/following/delete.ts index 8a9f739bd..7c285e9ea 100644 --- a/src/services/following/delete.ts +++ b/src/services/following/delete.ts @@ -56,7 +56,7 @@ export default async function(follower: IUser, followee: IUser) { } if (isLocalUser(follower) && isRemoteUser(followee)) { - const content = pack(renderUndo(renderFollow(follower, followee))); + const content = pack(renderUndo(renderFollow(follower, followee), follower)); deliver(follower, content, followee.inbox); } } diff --git a/src/services/following/requests/cancel.ts b/src/services/following/requests/cancel.ts index 26e4544d5..9655a95f0 100644 --- a/src/services/following/requests/cancel.ts +++ b/src/services/following/requests/cancel.ts @@ -8,7 +8,7 @@ import { publishUserStream } from '../../../stream'; export default async function(followee: IUser, follower: IUser) { if (isRemoteUser(followee)) { - const content = pack(renderUndo(renderFollow(follower, followee))); + const content = pack(renderUndo(renderFollow(follower, followee), follower)); deliver(follower as ILocalUser, content, followee.inbox); }