1
0
Fork 0
forked from mirror/pixelfed

Update AP Helpers

This commit is contained in:
Daniel Supernault 2020-07-20 08:39:48 -06:00
parent 3f2decd5e3
commit 692d3c8d1b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -24,6 +24,7 @@ use App\Jobs\StatusPipeline\NewStatusPipeline;
use App\Util\ActivityPub\HttpSignature; use App\Util\ActivityPub\HttpSignature;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use App\Services\ActivityPubDeliveryService; use App\Services\ActivityPubDeliveryService;
use App\Services\MediaPathService;
class Helpers { class Helpers {
@ -355,9 +356,7 @@ class Helpers {
} }
$attachments = isset($data['object']) ? $data['object']['attachment'] : $data['attachment']; $attachments = isset($data['object']) ? $data['object']['attachment'] : $data['attachment'];
$user = $status->profile; $user = $status->profile;
$monthHash = hash('sha1', date('Y').date('m')); $storagePath = MediaPathService::get($user, 2);
$userHash = hash('sha1', $user->id.(string) $user->created_at);
$storagePath = "public/m/{$monthHash}/{$userHash}";
$allowed = explode(',', config('pixelfed.media_types')); $allowed = explode(',', config('pixelfed.media_types'));
foreach($attachments as $media) { foreach($attachments as $media) {