Update delete pipelines, properly invoke StatusHashtag delete events

This commit is contained in:
Daniel Supernault 2023-11-11 03:40:59 -07:00
parent d24c60576f
commit ce54d29c69
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
3 changed files with 12 additions and 3 deletions

View file

@ -76,7 +76,10 @@ class DeleteRemoteStatusPipeline implements ShouldQueue
}); });
Mention::whereStatusId($status->id)->forceDelete(); Mention::whereStatusId($status->id)->forceDelete();
Report::whereObjectType('App\Status')->whereObjectId($status->id)->delete(); 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(); StatusView::whereStatusId($status->id)->delete();
Status::whereReblogOfId($status->id)->forceDelete(); Status::whereReblogOfId($status->id)->forceDelete();
$status->forceDelete(); $status->forceDelete();

View file

@ -153,7 +153,10 @@ class RemoteStatusDelete implements ShouldQueue, ShouldBeUniqueUntilProcessing
->whereObjectId($status->id) ->whereObjectId($status->id)
->delete(); ->delete();
StatusArchived::whereStatusId($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(); StatusView::whereStatusId($status->id)->delete();
Status::whereInReplyToId($status->id)->update(['in_reply_to_id' => null]); Status::whereInReplyToId($status->id)->update(['in_reply_to_id' => null]);

View file

@ -130,7 +130,10 @@ class StatusDelete implements ShouldQueue
->delete(); ->delete();
StatusArchived::whereStatusId($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(); StatusView::whereStatusId($status->id)->delete();
Status::whereInReplyToId($status->id)->update(['in_reply_to_id' => null]); Status::whereInReplyToId($status->id)->update(['in_reply_to_id' => null]);