mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 16:53:17 +00:00
Update FollowerController
This commit is contained in:
parent
a94e0ce40d
commit
ba8c101703
1 changed files with 2 additions and 1 deletions
|
@ -39,6 +39,7 @@ 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;
|
||||||
$blocked = UserFilter::whereUserId($target->id)
|
$blocked = UserFilter::whereUserId($target->id)
|
||||||
->whereFilterType('block')
|
->whereFilterType('block')
|
||||||
->whereFilterableId($user->id)
|
->whereFilterableId($user->id)
|
||||||
|
@ -51,7 +52,7 @@ class FollowerController extends Controller
|
||||||
|
|
||||||
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count();
|
$isFollowing = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->count();
|
||||||
|
|
||||||
if($private == true && $isFollowing == 0) {
|
if($private == true && $isFollowing == 0 || $remote == true) {
|
||||||
$follow = FollowRequest::firstOrCreate([
|
$follow = FollowRequest::firstOrCreate([
|
||||||
'follower_id' => $user->id,
|
'follower_id' => $user->id,
|
||||||
'following_id' => $target->id
|
'following_id' => $target->id
|
||||||
|
|
Loading…
Reference in a new issue