mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update FollowerController
This commit is contained in:
parent
38a0fd30fe
commit
dccaa2bd94
1 changed files with 7 additions and 3 deletions
|
@ -83,14 +83,18 @@ class FollowerController extends Controller
|
|||
$follower->profile_id = $user->id;
|
||||
$follower->following_id = $target->id;
|
||||
$follower->save();
|
||||
|
||||
|
||||
if($remote == true && config('federation.activitypub.remoteFollow') == true) {
|
||||
$this->sendFollow($user, $target);
|
||||
}
|
||||
FollowPipeline::dispatch($follower);
|
||||
} else {
|
||||
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail();
|
||||
if($remote == true) {
|
||||
$request = FollowRequest::whereFollowerId($user->id)->whereFollowingId($target->id)->exists();
|
||||
$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);
|
||||
}
|
||||
$follower->delete();
|
||||
|
|
Loading…
Reference in a new issue