mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +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);
|
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')
|
$items = DB::table('statuses')
|
||||||
->whereProfileId($pid)
|
->whereProfileId($pid)
|
||||||
->whereVisibility('public')
|
->whereVisibility('public')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace App\Jobs\StatusPipeline;
|
namespace App\Jobs\StatusPipeline;
|
||||||
|
|
||||||
use DB, Storage;
|
use DB, Cache, Storage;
|
||||||
use App\{
|
use App\{
|
||||||
AccountInterstitial,
|
AccountInterstitial,
|
||||||
Bookmark,
|
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) {
|
if(config_cache('federation.activitypub.enabled') == true) {
|
||||||
return $this->fanoutDelete($status);
|
return $this->fanoutDelete($status);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -12,6 +12,7 @@ use App\Services\PublicTimelineService;
|
||||||
use App\Util\Lexer\Autolink;
|
use App\Util\Lexer\Autolink;
|
||||||
use App\Util\Lexer\Extractor;
|
use App\Util\Lexer\Extractor;
|
||||||
use App\Util\Sentiment\Bouncer;
|
use App\Util\Sentiment\Bouncer;
|
||||||
|
use Cache;
|
||||||
use DB;
|
use DB;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
@ -166,6 +167,8 @@ class StatusEntityLexer implements ShouldQueue
|
||||||
if(config_cache('pixelfed.bouncer.enabled')) {
|
if(config_cache('pixelfed.bouncer.enabled')) {
|
||||||
Bouncer::get($status);
|
Bouncer::get($status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cache::forget('pf:atom:user-feed:by-id:' . $status->profile_id);
|
||||||
$hideNsfw = config('instance.hide_nsfw_on_public_feeds');
|
$hideNsfw = config('instance.hide_nsfw_on_public_feeds');
|
||||||
if( $status->uri == null &&
|
if( $status->uri == null &&
|
||||||
$status->scope == 'public' &&
|
$status->scope == 'public' &&
|
||||||
|
|
|
@ -24,12 +24,14 @@
|
||||||
</author>
|
</author>
|
||||||
<content type="html">
|
<content type="html">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<img id="rss_item_{{$loop->iteration}}" src="{{ $item['media_attachments'][0]['url'] }}" alt="{{ $item['media_attachments'][0]['description'] }}">
|
<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>
|
<p style="padding:10px;">{!! $item['content'] !!}</p>
|
||||||
]]>
|
]]>
|
||||||
</content>
|
</content>
|
||||||
<link rel="alternate" href="{{ $item['url'] }}" />
|
<link rel="alternate" href="{{ $item['url'] }}" />
|
||||||
|
@if($item['content'] && strlen($item['content']))
|
||||||
<summary type="html">{{ $item['content'] }}</summary>
|
<summary type="html">{{ $item['content'] }}</summary>
|
||||||
|
@endif
|
||||||
<media:content url="{{ $item['media_attachments'][0]['url'] }}" type="{{ $item['media_attachments'][0]['mime'] }}" medium="image" />
|
<media:content url="{{ $item['media_attachments'][0]['url'] }}" type="{{ $item['media_attachments'][0]['mime'] }}" medium="image" />
|
||||||
</entry>
|
</entry>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
Loading…
Reference in a new issue