From 63eceb8236a9d1042917e12f0c27d9f90d34ae32 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 14 Dec 2020 02:58:07 -0700 Subject: [PATCH 1/5] Update delete handler --- .../DeletePipeline/DeleteAccountPipeline.php | 35 +++++++++++++++++-- app/Jobs/StatusPipeline/StatusDelete.php | 7 +++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/app/Jobs/DeletePipeline/DeleteAccountPipeline.php b/app/Jobs/DeletePipeline/DeleteAccountPipeline.php index a225b48d9..18f238be5 100644 --- a/app/Jobs/DeletePipeline/DeleteAccountPipeline.php +++ b/app/Jobs/DeletePipeline/DeleteAccountPipeline.php @@ -24,8 +24,11 @@ use App\{ FollowRequest, Hashtag, HashtagFollow, + ImportData, + ImportJob, Like, Media, + MediaTag, Mention, Notification, OauthClient, @@ -81,10 +84,29 @@ class DeleteAccountPipeline implements ShouldQueue $id = $user->profile_id; - Bookmark::whereProfileId($user->profile_id)->forceDelete(); + ImportData::whereProfileId($id) + ->cursor() + ->each(function($data) { + $path = storage_path('app/'.$data->path); + if(is_file($path)) { + unlink($path); + } + $data->delete(); + }); + ImportJob::whereProfileId($id) + ->cursor() + ->each(function($data) { + $path = storage_path('app/'.$data->media_json); + if(is_file($path)) { + unlink($path); + } + $data->delete(); + }); + MediaTag::whereProfileId($id)->delete(); + Bookmark::whereProfileId($id)->forceDelete(); EmailVerification::whereUserId($user->id)->forceDelete(); StatusHashtag::whereProfileId($id)->delete(); - DirectMessage::whereFromId($user->profile_id)->delete(); + DirectMessage::whereFromId($id)->delete(); FollowRequest::whereFollowingId($id) ->orWhere('follower_id', $id) ->forceDelete(); @@ -143,7 +165,14 @@ class DeleteAccountPipeline implements ShouldQueue }); DB::transaction(function() use ($user) { - Status::whereProfileId($user->profile_id)->forceDelete(); + Status::whereProfileId($user->profile_id) + ->cursor() + ->each(function($status) { + AccountInterstitial::where('item_type', 'App\Status') + ->where('item_id', $status->id) + ->delete(); + $status->forceDelete(); + }); Report::whereUserId($user->id)->forceDelete(); $this->deleteProfile($user); }); diff --git a/app/Jobs/StatusPipeline/StatusDelete.php b/app/Jobs/StatusPipeline/StatusDelete.php index 09ba5ba5b..346f1cf6b 100644 --- a/app/Jobs/StatusPipeline/StatusDelete.php +++ b/app/Jobs/StatusPipeline/StatusDelete.php @@ -4,6 +4,7 @@ namespace App\Jobs\StatusPipeline; use DB; use App\{ + AccountInterstitial, MediaTag, Notification, Report, @@ -113,7 +114,11 @@ class StatusDelete implements ShouldQueue ->where('item_id', $tag->id) ->forceDelete(); $tag->delete(); - }); + }); + + AccountInterstitial::where('item_type', 'App\Status') + ->where('item_id', $status->id) + ->delete(); $status->forceDelete(); }); From 2454d8b2df13d3c6acbd2b7755cba87b525fe814 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 14 Dec 2020 03:03:26 -0700 Subject: [PATCH 2/5] Update nav menu --- resources/assets/js/components/Timeline.vue | 2 +- resources/views/layouts/partial/nav.blade.php | 46 +++++++------------ 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index a185005ab..39cc036bd 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -6,7 +6,7 @@

-
+

  {{scope == 'local' ? 'Public' : 'Home'}} Timeline

diff --git a/resources/views/layouts/partial/nav.blade.php b/resources/views/layouts/partial/nav.blade.php index 6dca08e36..dbd93068b 100644 --- a/resources/views/layouts/partial/nav.blade.php +++ b/resources/views/layouts/partial/nav.blade.php @@ -33,40 +33,45 @@

-
+
@@ -95,7 +95,7 @@
-
+