Update AP Inbox, add follow notifications

This commit is contained in:
Daniel Supernault 2020-05-24 03:21:40 -06:00
parent 5a731d7e66
commit b8819fbbfe
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 8 additions and 11 deletions

View File

@ -197,18 +197,9 @@ class Inbox
$follower->profile_id = $actor->id;
$follower->following_id = $target->id;
$follower->local_profile = empty($actor->domain);
$follower->save();
if($target->domain == null) {
Notification::firstOrCreate([
'profile_id' => $target->id,
'actor_id' => $actor->id,
'action' => 'follow',
'message' => $follower->toText(),
'rendered' => $follower->toHtml(),
'item_id' => $target->id,
'item_type' => 'App\Profile'
]);
}
FollowPipeline::dispatch($follower);
// send Accept to remote profile
$accept = [
@ -446,6 +437,12 @@ class Inbox
Follower::whereProfileId($profile->id)
->whereFollowingId($following->id)
->delete();
Notification::whereProfileId($following->id)
->whereActorId($profile->id)
->whereAction('follow')
->whereItemId($following->id)
->whereItemType('App\Profile')
->forceDelete();
break;
case 'Like':