From d51cafca742920c66b048b88fec99e85ad4a3292 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 20 Feb 2019 06:44:40 +0900 Subject: [PATCH] Fix #4326 --- src/services/following/requests/accept.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/following/requests/accept.ts b/src/services/following/requests/accept.ts index ecfe891f4d..284c6d5e19 100644 --- a/src/services/following/requests/accept.ts +++ b/src/services/following/requests/accept.ts @@ -8,14 +8,14 @@ import { publishMainStream } from '../../stream'; import { insertFollowingDoc } from '../create'; export default async function(followee: IUser, follower: IUser) { + const request = await FollowRequest.findOne({ + followeeId: followee._id, + followerId: follower._id + }); + await insertFollowingDoc(followee, follower); - if (isRemoteUser(follower)) { - const request = await FollowRequest.findOne({ - followeeId: followee._id, - followerId: follower._id - }); - + if (isRemoteUser(follower) && request) { const content = renderActivity(renderAccept(renderFollow(follower, followee, request.requestId), followee as ILocalUser)); deliver(followee as ILocalUser, content, follower.inbox); }