mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update FollowerController
This commit is contained in:
parent
26646a70a9
commit
a4bf848a3c
1 changed files with 5 additions and 1 deletions
|
@ -53,7 +53,7 @@ class FollowerController extends Controller
|
|||
abort(400, 'You cannot follow this user.');
|
||||
}
|
||||
|
||||
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count();
|
||||
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->exists();
|
||||
|
||||
if($private == true && $isFollowing == 0 || $remote == true) {
|
||||
if($user->following()->count() >= Follower::MAX_FOLLOWING) {
|
||||
|
@ -83,6 +83,10 @@ class FollowerController extends Controller
|
|||
$follower->profile_id = $user->id;
|
||||
$follower->following_id = $target->id;
|
||||
$follower->save();
|
||||
|
||||
if($remote == true && config('federation.activitypub.remoteFollow') == true) {
|
||||
$this->sendFollow($user, $target);
|
||||
}
|
||||
FollowPipeline::dispatch($follower);
|
||||
} else {
|
||||
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail();
|
||||
|
|
Loading…
Reference in a new issue