From 692d3c8d1b5e3bc36d471b2d06f305656f0684e5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 20 Jul 2020 08:39:48 -0600 Subject: [PATCH] Update AP Helpers --- app/Util/ActivityPub/Helpers.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index ef13e7b7..bd5bc95b 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -24,6 +24,7 @@ use App\Jobs\StatusPipeline\NewStatusPipeline; use App\Util\ActivityPub\HttpSignature; use Illuminate\Support\Str; use App\Services\ActivityPubDeliveryService; +use App\Services\MediaPathService; class Helpers { @@ -355,9 +356,7 @@ class Helpers { } $attachments = isset($data['object']) ? $data['object']['attachment'] : $data['attachment']; $user = $status->profile; - $monthHash = hash('sha1', date('Y').date('m')); - $userHash = hash('sha1', $user->id.(string) $user->created_at); - $storagePath = "public/m/{$monthHash}/{$userHash}"; + $storagePath = MediaPathService::get($user, 2); $allowed = explode(',', config('pixelfed.media_types')); foreach($attachments as $media) {