diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aa36a529..4453cdec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,15 @@ - Update FederationController, add proper following/follower counts ([3204fb96](https://github.com/pixelfed/pixelfed/commit/3204fb96)) - Update FederationController, add proper statuses counts ([3204fb96](https://github.com/pixelfed/pixelfed/commit/3204fb96)) - Update Inbox handler, fix missing object_url and uri fields for direct statuses ([a0157fce](https://github.com/pixelfed/pixelfed/commit/a0157fce)) +- Update DirectMessageController, deliver direct delete activities to user inbox instead of sharedInbox ([d848792a](https://github.com/pixelfed/pixelfed/commit/d848792a)) +- Update DirectMessageController, dispatch deliver and delete actions to the job queue ([7f462a80](https://github.com/pixelfed/pixelfed/commit/7f462a80)) +- Update Inbox, improve story attribute collection ([06bee36c](https://github.com/pixelfed/pixelfed/commit/06bee36c)) +- Update DirectMessageController, dispatch local deletes to pipeline ([98186564](https://github.com/pixelfed/pixelfed/commit/98186564)) +- Update StatusPipeline, fix Direct and Story notification deletion ([4c95306f](https://github.com/pixelfed/pixelfed/commit/4c95306f)) +- Update Notifications.vue, fix deprecated DM action links for story activities ([4c3823b0](https://github.com/pixelfed/pixelfed/commit/4c3823b0)) +- Update ComposeModal, fix missing alttext post state ([0a068119](https://github.com/pixelfed/pixelfed/commit/0a068119)) +- Update PhotoAlbumPresenter.vue, fix fullscreen mode ([822e9888](https://github.com/pixelfed/pixelfed/commit/822e9888)) +- Update Timeline.vue, improve CHT pagination ([9c43e7e2](https://github.com/pixelfed/pixelfed/commit/9c43e7e2)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9) diff --git a/app/Http/Controllers/DirectMessageController.php b/app/Http/Controllers/DirectMessageController.php index 959b944ce..b706572b3 100644 --- a/app/Http/Controllers/DirectMessageController.php +++ b/app/Http/Controllers/DirectMessageController.php @@ -17,6 +17,7 @@ use App\{ use App\Services\MediaPathService; use App\Services\MediaBlocklistService; use App\Jobs\StatusPipeline\NewStatusPipeline; +use App\Jobs\StatusPipeline\StatusDelete; use Illuminate\Support\Str; use App\Util\ActivityPub\Helpers; use App\Services\AccountService; @@ -502,6 +503,8 @@ class DirectMessageController extends Controller if($recipient['local'] == false) { $dmc = $dm; $this->remoteDelete($dmc); + } else { + StatusDelete::dispatch($status)->onQueue('high'); } if(Conversation::whereStatusId($sid)->count()) { @@ -543,9 +546,6 @@ class DirectMessageController extends Controller StatusService::del($status->id, true); - $status->delete(); - $dm->delete(); - return [200]; } diff --git a/app/Jobs/StatusPipeline/RemoteStatusDelete.php b/app/Jobs/StatusPipeline/RemoteStatusDelete.php index cb14288a1..78c41ed3d 100644 --- a/app/Jobs/StatusPipeline/RemoteStatusDelete.php +++ b/app/Jobs/StatusPipeline/RemoteStatusDelete.php @@ -40,6 +40,7 @@ use App\Services\CollectionService; use App\Services\StatusService; use App\Jobs\MediaPipeline\MediaDeletePipeline; use App\Jobs\ProfilePipeline\DecrementPostCount; +use App\Services\NotificationService; class RemoteStatusDelete implements ShouldQueue, ShouldBeUniqueUntilProcessing { @@ -137,14 +138,34 @@ class RemoteStatusDelete implements ShouldQueue, ShouldBeUniqueUntilProcessing CollectionService::removeItem($col->collection_id, $col->object_id); $col->delete(); }); - DirectMessage::whereStatusId($status->id)->delete(); + $dms = DirectMessage::whereStatusId($status->id)->get(); + foreach($dms as $dm) { + $not = Notification::whereItemType('App\DirectMessage') + ->whereItemId($dm->id) + ->first(); + if($not) { + NotificationService::del($not->profile_id, $not->id); + $not->forceDeleteQuietly(); + } + $dm->delete(); + } Like::whereStatusId($status->id)->forceDelete(); Media::whereStatusId($status->id) ->get() ->each(function($media) { MediaDeletePipeline::dispatch($media)->onQueue('mmo'); }); - MediaTag::where('status_id', $status->id)->delete(); + $mediaTags = MediaTag::where('status_id', $status->id)->get(); + foreach($mediaTags as $mtag) { + $not = Notification::whereItemType('App\MediaTag') + ->whereItemId($mtag->id) + ->first(); + if($not) { + NotificationService::del($not->profile_id, $not->id); + $not->forceDeleteQuietly(); + } + $mtag->delete(); + } Mention::whereStatusId($status->id)->forceDelete(); Notification::whereItemType('App\Status') ->whereItemId($status->id) diff --git a/app/Jobs/StatusPipeline/StatusDelete.php b/app/Jobs/StatusPipeline/StatusDelete.php index 5b200fdf0..c0ced1368 100644 --- a/app/Jobs/StatusPipeline/StatusDelete.php +++ b/app/Jobs/StatusPipeline/StatusDelete.php @@ -35,6 +35,7 @@ use GuzzleHttp\Promise; use App\Util\ActivityPub\HttpSignature; use App\Services\CollectionService; use App\Services\StatusService; +use App\Services\NotificationService; use App\Jobs\MediaPipeline\MediaDeletePipeline; class StatusDelete implements ShouldQueue @@ -115,10 +116,30 @@ class StatusDelete implements ShouldQueue $col->delete(); }); - DirectMessage::whereStatusId($status->id)->delete(); + $dms = DirectMessage::whereStatusId($status->id)->get(); + foreach($dms as $dm) { + $not = Notification::whereItemType('App\DirectMessage') + ->whereItemId($dm->id) + ->first(); + if($not) { + NotificationService::del($not->profile_id, $not->id); + $not->forceDeleteQuietly(); + } + $dm->delete(); + } Like::whereStatusId($status->id)->delete(); - MediaTag::where('status_id', $status->id)->delete(); + $mediaTags = MediaTag::where('status_id', $status->id)->get(); + foreach($mediaTags as $mtag) { + $not = Notification::whereItemType('App\MediaTag') + ->whereItemId($mtag->id) + ->first(); + if($not) { + NotificationService::del($not->profile_id, $not->id); + $not->forceDeleteQuietly(); + } + $mtag->delete(); + } Mention::whereStatusId($status->id)->forceDelete(); Notification::whereItemType('App\Status') diff --git a/resources/assets/components/sections/Notifications.vue b/resources/assets/components/sections/Notifications.vue index b2c904184..1ddf522fc 100644 --- a/resources/assets/components/sections/Notifications.vue +++ b/resources/assets/components/sections/Notifications.vue @@ -87,12 +87,12 @@
- {{n.account.local == false ? '@':''}}{{truncate(n.account.username)}} reacted to your story. + {{n.account.local == false ? '@':''}}{{truncate(n.account.username)}} reacted to your story.
- {{n.account.local == false ? '@':''}}{{truncate(n.account.username)}} commented on your story. + {{n.account.local == false ? '@':''}}{{truncate(n.account.username)}} commented on your story.