kopia lustrzana https://github.com/pixelfed/pixelfed
Update FollowerController, fix unfollow bug
rodzic
6a80146b0c
commit
a3404a20e1
|
@ -38,7 +38,6 @@ class FollowerController extends Controller
|
||||||
{
|
{
|
||||||
$user = Auth::user()->profile;
|
$user = Auth::user()->profile;
|
||||||
|
|
||||||
|
|
||||||
$target = Profile::where('id', '!=', $user->id)->whereNull('status')->findOrFail($item);
|
$target = Profile::where('id', '!=', $user->id)->whereNull('status')->findOrFail($item);
|
||||||
$private = (bool) $target->is_private;
|
$private = (bool) $target->is_private;
|
||||||
$remote = (bool) $target->domain;
|
$remote = (bool) $target->domain;
|
||||||
|
@ -54,7 +53,7 @@ class FollowerController extends Controller
|
||||||
|
|
||||||
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->exists();
|
$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) {
|
if($user->following()->count() >= Follower::MAX_FOLLOWING) {
|
||||||
abort(400, 'You cannot follow more than ' . Follower::MAX_FOLLOWING . ' accounts');
|
abort(400, 'You cannot follow more than ' . Follower::MAX_FOLLOWING . ' accounts');
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue