mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update atom feed, improve cache expiry and fix double encoding bug. Fixes #4121
This commit is contained in:
parent
3c712a70d6
commit
467c9d754e
4 changed files with 11 additions and 4 deletions
|
@ -207,7 +207,7 @@ class ProfileController extends Controller
|
|||
|
||||
abort_if(!$profile || $profile['locked'] || !$profile['local'], 404);
|
||||
|
||||
$data = Cache::remember('pf:atom:user-feed:by-id:' . $profile['id'], 86400, function() use($pid, $profile) {
|
||||
$data = Cache::remember('pf:atom:user-feed:by-id:' . $profile['id'], 43200, function() use($pid, $profile) {
|
||||
$items = DB::table('statuses')
|
||||
->whereProfileId($pid)
|
||||
->whereVisibility('public')
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Jobs\StatusPipeline;
|
||||
|
||||
use DB, Storage;
|
||||
use DB, Cache, Storage;
|
||||
use App\{
|
||||
AccountInterstitial,
|
||||
Bookmark,
|
||||
|
@ -81,6 +81,8 @@ class StatusDelete implements ShouldQueue
|
|||
}
|
||||
}
|
||||
|
||||
Cache::forget('pf:atom:user-feed:by-id:' . $status->profile_id);
|
||||
|
||||
if(config_cache('federation.activitypub.enabled') == true) {
|
||||
return $this->fanoutDelete($status);
|
||||
} else {
|
||||
|
|
|
@ -12,6 +12,7 @@ use App\Services\PublicTimelineService;
|
|||
use App\Util\Lexer\Autolink;
|
||||
use App\Util\Lexer\Extractor;
|
||||
use App\Util\Sentiment\Bouncer;
|
||||
use Cache;
|
||||
use DB;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
@ -166,6 +167,8 @@ class StatusEntityLexer implements ShouldQueue
|
|||
if(config_cache('pixelfed.bouncer.enabled')) {
|
||||
Bouncer::get($status);
|
||||
}
|
||||
|
||||
Cache::forget('pf:atom:user-feed:by-id:' . $status->profile_id);
|
||||
$hideNsfw = config('instance.hide_nsfw_on_public_feeds');
|
||||
if( $status->uri == null &&
|
||||
$status->scope == 'public' &&
|
||||
|
|
|
@ -24,12 +24,14 @@
|
|||
</author>
|
||||
<content type="html">
|
||||
<![CDATA[
|
||||
<img id="rss_item_{{$loop->iteration}}" src="{{ $item['media_attachments'][0]['url'] }}" alt="{{ $item['media_attachments'][0]['description'] }}">
|
||||
<p style="padding:10px;">{{ $item['content'] }}</p>
|
||||
<img id="rss_item_{{$item['id']}}" src="{{ $item['media_attachments'][0]['url'] }}" alt="{{ $item['media_attachments'][0]['description'] }}">
|
||||
<p style="padding:10px;">{!! $item['content'] !!}</p>
|
||||
]]>
|
||||
</content>
|
||||
<link rel="alternate" href="{{ $item['url'] }}" />
|
||||
@if($item['content'] && strlen($item['content']))
|
||||
<summary type="html">{{ $item['content'] }}</summary>
|
||||
@endif
|
||||
<media:content url="{{ $item['media_attachments'][0]['url'] }}" type="{{ $item['media_attachments'][0]['mime'] }}" medium="image" />
|
||||
</entry>
|
||||
@endforeach
|
||||
|
|
Loading…
Reference in a new issue