From 23463a44725eba2c95cc9b409284ff3dc0e7f50d Mon Sep 17 00:00:00 2001 From: Frinkeldoodle <3004186+Frinkel@users.noreply.github.com> Date: Thu, 18 Jul 2019 22:39:28 -0400 Subject: [PATCH 1/4] Remove Mastodon CoC msg for custom guidelines When an admin makes their own Community Guidelines page through the page editor, the message stating "Originally adapted from the Mastodon Code of Conduct" still appears, which may no longer be accurate in such a scenario (as the admin has probably written their own community guidelines in that case.) This edit simply removes that line. --- resources/views/site/help/community-guidelines.blade.php | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/views/site/help/community-guidelines.blade.php b/resources/views/site/help/community-guidelines.blade.php index 122113203..ba359733d 100644 --- a/resources/views/site/help/community-guidelines.blade.php +++ b/resources/views/site/help/community-guidelines.blade.php @@ -11,7 +11,6 @@ {!!$page->content!!}

This document was last updated {{$page->created_at->format('M d, Y')}}.

-

Originally adapted from the Mastodon Code of Conduct.

@else
From b14ad224ada5e2e974f940e47a5e22e96eee23fb Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 18 Jul 2019 21:52:37 -0600 Subject: [PATCH 2/4] Update Media model --- app/Media.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Media.php b/app/Media.php index e6ed99126..499d95b61 100644 --- a/app/Media.php +++ b/app/Media.php @@ -30,6 +30,7 @@ class Media extends Model public function url() { if(!empty($this->remote_media) && $this->remote_url) { + //$url = \App\Services\MediaProxyService::get($this->remote_url, $this->mime); $url = $this->remote_url; } else { $path = $this->media_path; From 8e942994d663337e14c52f348fb2d50403c58ee8 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 18 Jul 2019 21:53:02 -0600 Subject: [PATCH 3/4] Update Inbox --- app/Util/ActivityPub/Inbox.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 54aaa4af4..7c2f2332b 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -17,6 +17,7 @@ use App\Util\ActivityPub\Helpers; use App\Jobs\LikePipeline\LikePipeline; use App\Util\ActivityPub\Validator\{ + Accept, Follow }; From a60f167d496245269afb0636802ca9fb293d3959 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 18 Jul 2019 22:08:39 -0600 Subject: [PATCH 4/4] Update AP Helpers --- app/Util/ActivityPub/Helpers.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 49a881740..e9ea90e91 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -361,29 +361,16 @@ class Helpers { if(in_array($type, $allowed) == false || $valid == false) { continue; } - $info = pathinfo($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/pxmi-'.str_random(32); - file_put_contents($file, $img); - $fdata = new File($file); - $path = Storage::putFile($storagePath, $fdata, 'public'); $media = new Media(); $media->remote_media = true; $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->media_path = $url; + $media->remote_url = $url; + $media->mime = $type; $media->save(); - - ImageThumbnail::dispatch($media); - ImageOptimize::dispatch($media); - unlink($file); } $status->viewType();