Update ProfileController, refactor profile embeds

This commit is contained in:
Daniel Supernault 2024-04-20 04:33:47 -06:00
parent 9a7acc12a6
commit 8b8b1ffc5c
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
2 changed files with 6 additions and 6 deletions

View file

@ -254,7 +254,7 @@ class ProfileController extends Controller
abort_if(! $profile || $profile['locked'] || ! $profile['local'], 404); abort_if(! $profile || $profile['locked'] || ! $profile['local'], 404);
$aiCheck = Cache::remember('profile:ai-check:spam-login:'.$profile['id'], 86400, function () use ($profile) { $aiCheck = Cache::remember('profile:ai-check:spam-login:'.$profile['id'], 3600, function () use ($profile) {
$uid = User::whereProfileId($profile['id'])->first(); $uid = User::whereProfileId($profile['id'])->first();
if (! $uid) { if (! $uid) {
return true; return true;
@ -348,7 +348,7 @@ class ProfileController extends Controller
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']); return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
} }
$aiCheck = Cache::remember('profile:ai-check:spam-login:'.$profile->id, 86400, function () use ($profile) { $aiCheck = Cache::remember('profile:ai-check:spam-login:'.$profile->id, 3600, function () use ($profile) {
$exists = AccountInterstitial::whereUserId($profile->user_id)->where('is_spam', 1)->count(); $exists = AccountInterstitial::whereUserId($profile->user_id)->where('is_spam', 1)->count();
if ($exists) { if ($exists) {
return true; return true;

View file

@ -8,7 +8,7 @@
<title>{{ $title ?? config_cache('app.name', 'Pixelfed') }}</title> <title>{{ $title ?? config_cache('app.name', 'Pixelfed') }}</title>
<meta property="og:site_name" content="{{ config_cache('app.name', 'pixelfed') }}"> <meta property="og:site_name" content="{{ config_cache('app.name', 'pixelfed') }}">
<meta property="og:title" content="{{ $title ?? config_cache('app.name', 'pixelfed') }}"> <meta property="og:title" content="{{ $title ?? config_cache('app.name', 'pixelfed') }}">
<meta property="og:type" content="article"> <meta property="og:type" content="profile">
<meta property="og:url" content="{{$profile['url']}}"> <meta property="og:url" content="{{$profile['url']}}">
<meta name="medium" content="image"> <meta name="medium" content="image">
<meta name="theme-color" content="#10c5f8"> <meta name="theme-color" content="#10c5f8">
@ -43,7 +43,7 @@
<p class="mb-0 text-muted text-uppercase small font-weight-bold">Followers</p> <p class="mb-0 text-muted text-uppercase small font-weight-bold">Followers</p>
</div> </div>
<div class="text-center"> <div class="text-center">
<p class="mb-0"><a href="/i/intent/follow?user={{$profile['username']}}" class="btn btn-primary btn-sm py-1 px-4 text-uppercase font-weight-bold" target="_blank">Follow</a></p> <p class="mb-0"><a href="{{config('app.url')}}/i/intent/follow?user={{$profile['username']}}" class="btn btn-primary btn-sm py-1 px-4 text-uppercase font-weight-bold" target="_blank">Follow</a></p>
</div> </div>
</div> </div>
<div class="row mt-4 mb-1 embed-row"></div> <div class="row mt-4 mb-1 embed-row"></div>