From e9c86461372ca07b85fb83758aa1b060ea07921b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jun 2019 11:38:24 -0600 Subject: [PATCH 1/4] Closes #1368 --- resources/assets/js/components/PostComponent.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index aa5e0bb84..5d62618a4 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -728,8 +728,10 @@ export default { type: 'status', item: this.status.id }).then(res => { - swal('Success', 'You have successfully deleted this post', 'success'); - window.location.href = '/'; + setTimeout(function() { + swal('Success', 'You have successfully deleted this post', 'success'); + window.location.href = '/'; + }, 2000); }).catch(err => { swal('Error', 'Something went wrong. Please try again later.', 'error'); }); From e14e18e6b408fa90e2a087d2c85a035be2edf5aa Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jun 2019 12:53:15 -0600 Subject: [PATCH 2/4] Update VideoThumbnail pipeline --- app/Jobs/VideoPipeline/VideoThumbnail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/VideoPipeline/VideoThumbnail.php b/app/Jobs/VideoPipeline/VideoThumbnail.php index de9b31077..e988091f1 100644 --- a/app/Jobs/VideoPipeline/VideoThumbnail.php +++ b/app/Jobs/VideoPipeline/VideoThumbnail.php @@ -42,7 +42,7 @@ class VideoThumbnail implements ShouldQueue $name = last($path); try { $t = explode('.', $name); - $t = $t[0].'_thumb.png'; + $t = $t[0].'_thumb.jpeg'; $i = count($path) - 1; $path[$i] = $t; $save = implode('/', $path); From f6e652223d44a6b3ef3a6fe4fb1cdbcc9f156171 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jun 2019 12:53:32 -0600 Subject: [PATCH 3/4] Update AP Helpers --- app/Util/ActivityPub/Helpers.php | 42 +++++++++++++++----------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index e38b4ca06..d9c69e6bf 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -319,7 +319,7 @@ class Helpers { $status->scope = $scope; $status->visibility = $scope; $status->save(); - // self::importNoteAttachment($res, $status); + self::importNoteAttachment($res, $status); return $status; }); @@ -330,8 +330,6 @@ class Helpers { public static function importNoteAttachment($data, Status $status) { - return; - if(self::verifyAttachments($data) == false) { return; } @@ -348,28 +346,28 @@ class Helpers { if(in_array($type, $allowed) == false || $valid == false) { continue; } - // $info = pathinfo($url); + $info = pathinfo($url); - // // pleroma attachment fix - // $url = str_replace(' ', '%20', $url); + // pleroma attachment fix + $url = str_replace(' ', '%20', $url); - // $img = file_get_contents($url, false, stream_context_create(['ssl' => ["verify_peer"=>true,"verify_peer_name"=>true]])); - // $file = '/tmp/'.str_random(32); - // file_put_contents($file, $img); - // $fdata = new File($file); - // $path = Storage::putFile($storagePath, $fdata, 'public'); - // $media = new Media(); - // $media->status_id = $status->id; - // $media->profile_id = $status->profile_id; - // $media->user_id = null; - // $media->media_path = $path; - // $media->size = $fdata->getSize(); - // $media->mime = $fdata->getMimeType(); - // $media->save(); + $img = file_get_contents($url, false, stream_context_create(['ssl' => ["verify_peer"=>true,"verify_peer_name"=>true]])); + $file = '/tmp/pxmi-'.str_random(32); + file_put_contents($file, $img); + $fdata = new File($file); + $path = Storage::putFile($storagePath, $fdata, 'public'); + $media = new Media(); + $media->status_id = $status->id; + $media->profile_id = $status->profile_id; + $media->user_id = null; + $media->media_path = $path; + $media->size = $fdata->getSize(); + $media->mime = $fdata->getMimeType(); + $media->save(); - // ImageThumbnail::dispatch($media); - // ImageOptimize::dispatch($media); - // unlink($file); + ImageThumbnail::dispatch($media); + ImageOptimize::dispatch($media); + unlink($file); } return; } From c694abc23a6b10d121bd8a84eeb848b133a63ed4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jun 2019 14:13:43 -0600 Subject: [PATCH 4/4] Update AccountTransformer, add website --- app/Transformer/Api/AccountTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Transformer/Api/AccountTransformer.php b/app/Transformer/Api/AccountTransformer.php index 0fd3ef21a..e29c8616b 100644 --- a/app/Transformer/Api/AccountTransformer.php +++ b/app/Transformer/Api/AccountTransformer.php @@ -30,7 +30,7 @@ class AccountTransformer extends Fractal\TransformerAbstract 'moved' => null, 'fields' => null, 'bot' => null, - 'website' => null, + 'website' => $profile->website, 'software' => 'pixelfed', 'is_admin' => (bool) $is_admin ];