From 548a12a4c24c4094839b7a772c1a0607ac867b74 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 13 Feb 2022 02:14:26 -0700 Subject: [PATCH 1/2] Update StatusController, set missing reblog/share type --- app/Http/Controllers/Api/ApiV1Controller.php | 1 + app/Http/Controllers/StatusController.php | 1 + ...g_reblog_of_id_types_to_statuses_table.php | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index d76999430..7e11a6591 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2247,6 +2247,7 @@ class ApiV1Controller extends Controller $share = Status::firstOrCreate([ 'profile_id' => $user->profile_id, 'reblog_of_id' => $status->id, + 'type' => 'share', 'in_reply_to_profile_id' => $status->profile_id, 'scope' => 'public', 'visibility' => 'public' diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 91c187a38..edea1ea1e 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -254,6 +254,7 @@ class StatusController extends Controller $share->profile_id = $profile->id; $share->reblog_of_id = $status->id; $share->in_reply_to_profile_id = $status->profile_id; + $share->type = 'share'; $share->save(); $count++; SharePipeline::dispatch($share); diff --git a/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php b/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php new file mode 100644 index 000000000..39b6bc64c --- /dev/null +++ b/database/migrations/2022_02_13_091135_add_missing_reblog_of_id_types_to_statuses_table.php @@ -0,0 +1,32 @@ +whereNull('type') + ->update([ + 'type' => 'share' + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } +} From 7c9e429839b9f22f1f1d12cf37487d77dd6a42cc Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 13 Feb 2022 02:14:54 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e89cbf105..9d57f7882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Updated StatusTagsPipeline, process federated hashtags and mentions ([a84b1736](https://github.com/pixelfed/pixelfed/commit/a84b1736)) - Updated Inbox, fix undo announce. ([cf286fb0](https://github.com/pixelfed/pixelfed/commit/cf286fb0)) - Updated ApiV1Controller, improve favourites endpoint. ([151dc17c](https://github.com/pixelfed/pixelfed/commit/151dc17c)) +- Updated StatusController, set missing reblog/share type. ([548a12a4](https://github.com/pixelfed/pixelfed/commit/548a12a4)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.2 (2022-01-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.1...v0.11.2)