フォローしているユーザーからのフォローを自動承認するオプション (#3780)
This commit is contained in:
parent
65a82f32be
commit
8823a6c1a1
5 changed files with 35 additions and 3 deletions
|
@ -45,8 +45,22 @@ export default async function(follower: IUser, followee: IUser, requestId?: stri
|
|||
// フォロワーがローカルユーザーであり、フォロー対象がリモートユーザーである
|
||||
// 上記のいずれかに当てはまる場合はすぐフォローせずにフォローリクエストを発行しておく
|
||||
if (followee.isLocked || (followee.carefulBot && follower.isBot) || (isLocalUser(follower) && isRemoteUser(followee))) {
|
||||
await createFollowRequest(follower, followee, requestId);
|
||||
return;
|
||||
let autoAccept = false;
|
||||
|
||||
// フォローしているユーザーは自動承認オプション
|
||||
if (isLocalUser(followee) && followee.autoAcceptFollowed) {
|
||||
const followed = await Following.findOne({
|
||||
followerId: followee._id,
|
||||
followeeId: follower._id
|
||||
});
|
||||
|
||||
if (followed) autoAccept = true;
|
||||
}
|
||||
|
||||
if (!autoAccept) {
|
||||
await createFollowRequest(follower, followee, requestId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await Following.insert({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue