diff --git a/CHANGELOG.md b/CHANGELOG.md index f358f7f17..40730935c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,8 @@ - Updated Inbox, move expensive HTTP Signature validation to job queue ([f2ae45e5a](https://github.com/pixelfed/pixelfed/commit/f2ae45e5a)) - Updated MomentUI, fix bugs and improve UI ([90b89cb8](https://github.com/pixelfed/pixelfed/commit/90b89cb8)) - Updated PostComponent, improve embed model. Fixes ([#2189](https://github.com/pixelfed/pixelfed/issues/2189)) ([b12e504e](https://github.com/pixelfed/pixelfed/commit/b12e504e)) -- Updated PostComponent, hide edit button after 24 hours. Fixes [#2188](https://github.com/pixelfed/pixelfed/issues/2188)) ([a1fee6a2](https://github.com/pixelfed/pixelfed/commit/a1fee6a2)) +- Updated PostComponent, hide edit button after 24 hours. Fixes ([#2188](https://github.com/pixelfed/pixelfed/issues/2188)) ([a1fee6a2](https://github.com/pixelfed/pixelfed/commit/a1fee6a2)) +- Updated AP Inbox, add follow notifications ([b8819fbb](https://github.com/pixelfed/pixelfed/commit/b8819fbb)) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 0a190409a..0d19d97ca 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -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':