mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +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()
|
public function url()
|
||||||
{
|
{
|
||||||
if(!empty($this->remote_media) && $this->remote_url) {
|
if(!empty($this->remote_media) && $this->remote_url) {
|
||||||
|
//$url = \App\Services\MediaProxyService::get($this->remote_url, $this->mime);
|
||||||
$url = $this->remote_url;
|
$url = $this->remote_url;
|
||||||
} else {
|
} else {
|
||||||
$path = $this->media_path;
|
$path = $this->media_path;
|
||||||
|
|
|
@ -361,29 +361,16 @@ class Helpers {
|
||||||
if(in_array($type, $allowed) == false || $valid == false) {
|
if(in_array($type, $allowed) == false || $valid == false) {
|
||||||
continue;
|
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 = new Media();
|
||||||
$media->remote_media = true;
|
$media->remote_media = true;
|
||||||
$media->status_id = $status->id;
|
$media->status_id = $status->id;
|
||||||
$media->profile_id = $status->profile_id;
|
$media->profile_id = $status->profile_id;
|
||||||
$media->user_id = null;
|
$media->user_id = null;
|
||||||
$media->media_path = $path;
|
$media->media_path = $url;
|
||||||
$media->size = $fdata->getSize();
|
$media->remote_url = $url;
|
||||||
$media->mime = $fdata->getMimeType();
|
$media->mime = $type;
|
||||||
$media->save();
|
$media->save();
|
||||||
|
|
||||||
ImageThumbnail::dispatch($media);
|
|
||||||
ImageOptimize::dispatch($media);
|
|
||||||
unlink($file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$status->viewType();
|
$status->viewType();
|
||||||
|
|
|
@ -17,6 +17,7 @@ use App\Util\ActivityPub\Helpers;
|
||||||
use App\Jobs\LikePipeline\LikePipeline;
|
use App\Jobs\LikePipeline\LikePipeline;
|
||||||
|
|
||||||
use App\Util\ActivityPub\Validator\{
|
use App\Util\ActivityPub\Validator\{
|
||||||
|
Accept,
|
||||||
Follow
|
Follow
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
{!!$page->content!!}
|
{!!$page->content!!}
|
||||||
<hr>
|
<hr>
|
||||||
<p class="">This document was last updated {{$page->created_at->format('M d, Y')}}.</p>
|
<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>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in a new issue