From ce54d29c695ce3f783817af194be86af6e3f493e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 11 Nov 2023 03:40:59 -0700 Subject: [PATCH] Update delete pipelines, properly invoke StatusHashtag delete events --- app/Jobs/DeletePipeline/DeleteRemoteStatusPipeline.php | 5 ++++- app/Jobs/StatusPipeline/RemoteStatusDelete.php | 5 ++++- app/Jobs/StatusPipeline/StatusDelete.php | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Jobs/DeletePipeline/DeleteRemoteStatusPipeline.php b/app/Jobs/DeletePipeline/DeleteRemoteStatusPipeline.php index 4969fca2f..353509c6c 100644 --- a/app/Jobs/DeletePipeline/DeleteRemoteStatusPipeline.php +++ b/app/Jobs/DeletePipeline/DeleteRemoteStatusPipeline.php @@ -76,7 +76,10 @@ class DeleteRemoteStatusPipeline implements ShouldQueue }); Mention::whereStatusId($status->id)->forceDelete(); Report::whereObjectType('App\Status')->whereObjectId($status->id)->delete(); - StatusHashtag::whereStatusId($status->id)->delete(); + $statusHashtags = StatusHashtag::whereStatusId($status->id)->get(); + foreach($statusHashtags as $stag) { + $stag->delete(); + } StatusView::whereStatusId($status->id)->delete(); Status::whereReblogOfId($status->id)->forceDelete(); $status->forceDelete(); diff --git a/app/Jobs/StatusPipeline/RemoteStatusDelete.php b/app/Jobs/StatusPipeline/RemoteStatusDelete.php index aabb81755..cb14288a1 100644 --- a/app/Jobs/StatusPipeline/RemoteStatusDelete.php +++ b/app/Jobs/StatusPipeline/RemoteStatusDelete.php @@ -153,7 +153,10 @@ class RemoteStatusDelete implements ShouldQueue, ShouldBeUniqueUntilProcessing ->whereObjectId($status->id) ->delete(); StatusArchived::whereStatusId($status->id)->delete(); - StatusHashtag::whereStatusId($status->id)->delete(); + $statusHashtags = StatusHashtag::whereStatusId($status->id)->get(); + foreach($statusHashtags as $stag) { + $stag->delete(); + } StatusView::whereStatusId($status->id)->delete(); Status::whereInReplyToId($status->id)->update(['in_reply_to_id' => null]); diff --git a/app/Jobs/StatusPipeline/StatusDelete.php b/app/Jobs/StatusPipeline/StatusDelete.php index 19c0ea68d..5b200fdf0 100644 --- a/app/Jobs/StatusPipeline/StatusDelete.php +++ b/app/Jobs/StatusPipeline/StatusDelete.php @@ -130,7 +130,10 @@ class StatusDelete implements ShouldQueue ->delete(); StatusArchived::whereStatusId($status->id)->delete(); - StatusHashtag::whereStatusId($status->id)->delete(); + $statusHashtags = StatusHashtag::whereStatusId($status->id)->get(); + foreach($statusHashtags as $stag) { + $stag->delete(); + } StatusView::whereStatusId($status->id)->delete(); Status::whereInReplyToId($status->id)->update(['in_reply_to_id' => null]);