From 43864f0da427285cecb502328be819f2e6eb5883 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Fri, 15 Feb 2019 05:56:28 +0900
Subject: [PATCH] =?UTF-8?q?=E6=97=A2=E3=81=AB=E3=83=95=E3=82=A9=E3=83=AD?=
 =?UTF-8?q?=E3=83=BC=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E5=A0=B4?=
 =?UTF-8?q?=E5=90=88=E3=81=AF=E3=83=95=E3=82=A9=E3=83=AD=E3=83=BC=E3=83=AA?=
 =?UTF-8?q?=E3=82=AF=E3=82=A8=E3=82=B9=E3=83=88=E3=82=92=E7=94=9F=E6=88=90?=
 =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=20(#4266?=
 =?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/services/following/create.ts | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/services/following/create.ts b/src/services/following/create.ts
index a050f40b0e..5a92e4103a 100644
--- a/src/services/following/create.ts
+++ b/src/services/following/create.ts
@@ -153,8 +153,17 @@ export default async function(follower: IUser, followee: IUser, requestId?: stri
 	if (followee.isLocked || (followee.carefulBot && follower.isBot) || (isLocalUser(follower) && isRemoteUser(followee))) {
 		let autoAccept = false;
 
+		// 鍵アカウントであっても、既にフォローされていた場合はスルー
+		const following = await Following.findOne({
+			followerId: follower._id,
+			followeeId: followee._id,
+		});
+		if (following) {
+			autoAccept = true;
+		}
+
 		// フォローしているユーザーは自動承認オプション
-		if (isLocalUser(followee) && followee.autoAcceptFollowed) {
+		if (!autoAccept && (isLocalUser(followee) && followee.autoAcceptFollowed)) {
 			const followed = await Following.findOne({
 				followerId: followee._id,
 				followeeId: follower._id