Update FollowerController

pull/1595/head
Daniel Supernault 2019-08-12 02:47:20 -06:00
rodzic 38a0fd30fe
commit dccaa2bd94
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -89,8 +89,12 @@ class FollowerController extends Controller
} }
FollowPipeline::dispatch($follower); FollowPipeline::dispatch($follower);
} else { } else {
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail(); $request = FollowRequest::whereFollowerId($user->id)->whereFollowingId($target->id)->exists();
if($remote == true) { $follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->exists();
if($remote == true && $request && !$follower) {
$this->sendFollow($user, $target);
}
if($remote == true && $follower) {
$this->sendUndoFollow($user, $target); $this->sendUndoFollow($user, $target);
} }
$follower->delete(); $follower->delete();