mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Merge pull request #1526 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
1f8bff2729
4 changed files with 5 additions and 17 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -17,6 +17,7 @@ use App\Util\ActivityPub\Helpers;
|
|||
use App\Jobs\LikePipeline\LikePipeline;
|
||||
|
||||
use App\Util\ActivityPub\Validator\{
|
||||
Accept,
|
||||
Follow
|
||||
};
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
{!!$page->content!!}
|
||||
<hr>
|
||||
<p class="">This document was last updated {{$page->created_at->format('M d, Y')}}.</p>
|
||||
<p class="">Originally adapted from the <a href="https://mastodon.social/about/more">Mastodon</a> Code of Conduct.</p>
|
||||
</div>
|
||||
@else
|
||||
<div>
|
||||
|
|
Loading…
Reference in a new issue