From 1f2183ee677a8f860298ff8d51eee90b1b392a87 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 25 May 2023 04:57:17 -0600 Subject: [PATCH 1/2] Update StatusActivityPubDeliver, fix addressing --- .../StatusActivityPubDeliver.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php b/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php index ca77ff7fc..1292988f5 100644 --- a/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php +++ b/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php @@ -3,6 +3,7 @@ namespace App\Jobs\StatusPipeline; use Cache, Log; +use App\Profile; use App\Status; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -52,12 +53,36 @@ class StatusActivityPubDeliver implements ShouldQueue $status = $this->status; $profile = $status->profile; + // ignore group posts + // if($status->group_id != null) { + // return; + // } + if($status->local == false || $status->url || $status->uri) { return; } $audience = $status->profile->getAudienceInbox(); + $parentInbox = []; + + $mentions = $status->mentions + ->filter(function($f) { return $f->domain !== null;}) + ->values() + ->map(function($m) { return $m->sharedInbox ?? $m->inbox_url; }) + ->toArray(); + + if($status->in_reply_to_profile_id) { + $parent = Profile::find($status->in_reply_to_profile_id); + if($parent && $parent->domain !== null) { + $parentInbox = [ + $parent->sharedInbox ?? $parent->inbox_url + ]; + } + } + + $audience = array_values(array_unique(array_merge($audience, $mentions, $parentInbox))); + if(empty($audience) || !in_array($status->scope, ['public', 'unlisted', 'private'])) { // Return on profiles with no remote followers return; From 57d4f67b85e61d427dce510d7d2881a06fb46289 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 25 May 2023 04:57:55 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8441e43bb..cb961f78f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Update Config, bump version for post edit support without having to clear cache ([c0190d84](https://github.com/pixelfed/pixelfed/commit/c0190d84)) - Update EditHistoryModal, fix caption rendering ([0f803446](https://github.com/pixelfed/pixelfed/commit/0f803446)) - Update StatusRemoteUpdatePipeline, fix typo ([109d0419](https://github.com/pixelfed/pixelfed/commit/109d0419)) +- Update StatusActivityPubDeliver, fix delivery addressing ([1f2183ee](https://github.com/pixelfed/pixelfed/commit/1f2183ee)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.7 (2023-05-24)](https://github.com/pixelfed/pixelfed/compare/v0.11.6...v0.11.7)