|
|
|
@ -2,20 +2,19 @@
|
|
|
|
|
|
|
|
|
|
namespace App\Jobs\StatusPipeline;
|
|
|
|
|
|
|
|
|
|
use App\Media;
|
|
|
|
|
use App\Models\StatusEdit;
|
|
|
|
|
use App\ModLog;
|
|
|
|
|
use App\Profile;
|
|
|
|
|
use App\Services\StatusService;
|
|
|
|
|
use App\Status;
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
use App\Media;
|
|
|
|
|
use App\ModLog;
|
|
|
|
|
use App\Profile;
|
|
|
|
|
use App\Status;
|
|
|
|
|
use App\Models\StatusEdit;
|
|
|
|
|
use App\Services\StatusService;
|
|
|
|
|
use Purify;
|
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
|
use Purify;
|
|
|
|
|
|
|
|
|
|
class StatusRemoteUpdatePipeline implements ShouldQueue
|
|
|
|
|
{
|
|
|
|
@ -57,7 +56,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
|
|
|
|
'spoiler_text' => $status->cw_summary,
|
|
|
|
|
'is_nsfw' => $status->is_nsfw,
|
|
|
|
|
'ordered_media_attachment_ids' => $status->media()->orderBy('order')->pluck('id')->toArray(),
|
|
|
|
|
'created_at' => $status->created_at
|
|
|
|
|
'created_at' => $status->created_at,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -75,7 +74,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
|
|
|
|
$nm['url']
|
|
|
|
|
) &&
|
|
|
|
|
in_array($nm['type'], ['Document', 'Image', 'Video']) &&
|
|
|
|
|
in_array($nm['mediaType'], explode(',', config('pixelfed.media_types')));
|
|
|
|
|
in_array($nm['mediaType'], explode(',', config_cache('pixelfed.media_types')));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Skip when no media
|
|
|
|
@ -86,7 +85,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
|
|
|
|
Media::whereProfileId($status->profile_id)
|
|
|
|
|
->whereStatusId($status->id)
|
|
|
|
|
->update([
|
|
|
|
|
'status_id' => null
|
|
|
|
|
'status_id' => null,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$nm->each(function ($n, $key) use ($status) {
|
|
|
|
@ -96,7 +95,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!in_array($res->header('content-type'), explode(',',config('pixelfed.media_types')))) {
|
|
|
|
|
if (! in_array($res->header('content-type'), explode(',', config_cache('pixelfed.media_types')))) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -167,7 +166,7 @@ class StatusRemoteUpdatePipeline implements ShouldQueue
|
|
|
|
|
'caption' => $cleaned,
|
|
|
|
|
'spoiler_text' => $spoiler_text,
|
|
|
|
|
'is_nsfw' => $sensitive,
|
|
|
|
|
'ordered_media_attachment_ids' => $mids
|
|
|
|
|
'ordered_media_attachment_ids' => $mids,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|