mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Update AP Inbox, add follow notifications
This commit is contained in:
parent
5a731d7e66
commit
b8819fbbfe
1 changed files with 8 additions and 11 deletions
|
@ -197,18 +197,9 @@ class Inbox
|
||||||
$follower->profile_id = $actor->id;
|
$follower->profile_id = $actor->id;
|
||||||
$follower->following_id = $target->id;
|
$follower->following_id = $target->id;
|
||||||
$follower->local_profile = empty($actor->domain);
|
$follower->local_profile = empty($actor->domain);
|
||||||
|
$follower->save();
|
||||||
|
|
||||||
if($target->domain == null) {
|
FollowPipeline::dispatch($follower);
|
||||||
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'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// send Accept to remote profile
|
// send Accept to remote profile
|
||||||
$accept = [
|
$accept = [
|
||||||
|
@ -446,6 +437,12 @@ class Inbox
|
||||||
Follower::whereProfileId($profile->id)
|
Follower::whereProfileId($profile->id)
|
||||||
->whereFollowingId($following->id)
|
->whereFollowingId($following->id)
|
||||||
->delete();
|
->delete();
|
||||||
|
Notification::whereProfileId($following->id)
|
||||||
|
->whereActorId($profile->id)
|
||||||
|
->whereAction('follow')
|
||||||
|
->whereItemId($following->id)
|
||||||
|
->whereItemType('App\Profile')
|
||||||
|
->forceDelete();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Like':
|
case 'Like':
|
||||||
|
|
Loading…
Reference in a new issue