mirror of https://github.com/pixelfed/pixelfed.git
Update AP Helpers
This commit is contained in:
parent
751ccecd2e
commit
52d2f603af
|
@ -55,8 +55,8 @@ class Helpers {
|
||||||
|
|
||||||
$activity = $data['object'];
|
$activity = $data['object'];
|
||||||
|
|
||||||
$mediaTypes = ['Document', 'Image', 'Video'];
|
$mimeTypes = explode(',', config('pixelfed.media_types'));
|
||||||
$mimeTypes = ['image/jpeg', 'image/png', 'video/mp4'];
|
$mediaTypes = in_array('video/mp4', $mimeTypes) ? ['Document', 'Image', 'Video'] : ['Document', 'Image'];
|
||||||
|
|
||||||
if(!isset($activity['attachment']) || empty($activity['attachment'])) {
|
if(!isset($activity['attachment']) || empty($activity['attachment'])) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -249,7 +249,6 @@ class Helpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($res['cc']) == true) {
|
if(isset($res['cc']) == true) {
|
||||||
$scope = 'unlisted';
|
|
||||||
if(is_array($res['cc']) && in_array('https://www.w3.org/ns/activitystreams#Public', $res['cc'])) {
|
if(is_array($res['cc']) && in_array('https://www.w3.org/ns/activitystreams#Public', $res['cc'])) {
|
||||||
$scope = 'unlisted';
|
$scope = 'unlisted';
|
||||||
}
|
}
|
||||||
|
@ -339,6 +338,7 @@ class Helpers {
|
||||||
$userHash = hash('sha1', $user->id.(string) $user->created_at);
|
$userHash = hash('sha1', $user->id.(string) $user->created_at);
|
||||||
$storagePath = "public/m/{$monthHash}/{$userHash}";
|
$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) {
|
||||||
$type = $media['mediaType'];
|
$type = $media['mediaType'];
|
||||||
$url = $media['url'];
|
$url = $media['url'];
|
||||||
|
@ -370,6 +370,8 @@ class Helpers {
|
||||||
ImageOptimize::dispatch($media);
|
ImageOptimize::dispatch($media);
|
||||||
unlink($file);
|
unlink($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$status->viewType();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue