mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update FollowerController, fix unfollow bug
This commit is contained in:
parent
6a80146b0c
commit
a3404a20e1
1 changed files with 1 additions and 2 deletions
|
@ -38,7 +38,6 @@ class FollowerController extends Controller
|
|||
{
|
||||
$user = Auth::user()->profile;
|
||||
|
||||
|
||||
$target = Profile::where('id', '!=', $user->id)->whereNull('status')->findOrFail($item);
|
||||
$private = (bool) $target->is_private;
|
||||
$remote = (bool) $target->domain;
|
||||
|
@ -54,7 +53,7 @@ class FollowerController extends Controller
|
|||
|
||||
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->exists();
|
||||
|
||||
if($private == true && $isFollowing == 0 || $remote == true) {
|
||||
if($private == true && $isFollowing == 0 && $remote == true) {
|
||||
if($user->following()->count() >= Follower::MAX_FOLLOWING) {
|
||||
abort(400, 'You cannot follow more than ' . Follower::MAX_FOLLOWING . ' accounts');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue