Update ApiV1Controller, improve follower handling

pull/5881/head
Daniel Supernault 3 weeks ago
parent 75e7a678ce
commit 976a1873e1
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -864,15 +864,20 @@ class ApiV1Controller extends Controller
if ($remote == true && config('federation.activitypub.remoteFollow') == true) {
(new FollowerController)->sendFollow($user->profile, $target);
}
} else {
$follower = Follower::firstOrCreate([
'profile_id' => $user->profile_id,
} elseif ($remote == true) {
$follow = FollowRequest::firstOrCreate([
'follower_id' => $user->profile_id,
'following_id' => $target->id,
]);
if ($remote == true && config('federation.activitypub.remoteFollow') == true) {
if (config('federation.activitypub.remoteFollow') == true) {
(new FollowerController)->sendFollow($user->profile, $target);
}
} else {
$follower = Follower::firstOrCreate([
'profile_id' => $user->profile_id,
'following_id' => $target->id,
]);
FollowPipeline::dispatch($follower)->onQueue('high');
}

Loading…
Cancel
Save