Update FollowerController, fix unfollow bug

pull/1708/head
Daniel Supernault 2019-09-23 18:47:41 -06:00
rodzic 6a80146b0c
commit a3404a20e1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -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');
}