Merge pull request #2569 from pixelfed/staging

Staging
This commit is contained in:
daniel 2021-01-14 18:54:40 -07:00 committed by GitHub
commit 91b7c043be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View file

@ -1435,13 +1435,15 @@ class ApiV1Controller extends Controller
$limit = $request->input('limit') ?? 3; $limit = $request->input('limit') ?? 3;
$user = $request->user(); $user = $request->user();
$key = 'user:last_active_at:id:'.$user->id; if($user) {
$ttl = now()->addMinutes(5); $key = 'user:last_active_at:id:'.$user->id;
Cache::remember($key, $ttl, function() use($user) { $ttl = now()->addMinutes(5);
$user->last_active_at = now(); Cache::remember($key, $ttl, function() use($user) {
$user->save(); $user->last_active_at = now();
return; $user->save();
}); return;
});
}
if($min || $max) { if($min || $max) {
$dir = $min ? '>' : '<'; $dir = $min ? '>' : '<';

View file

@ -80,7 +80,8 @@ class InboxValidator implements ShouldQueue
$headers, $headers,
$payload, $payload,
$actor, $actor,
$hash $hash,
$profile
) { ) {
$key = 'ap:inbox:actor-delete-exists:' . $hash; $key = 'ap:inbox:actor-delete-exists:' . $hash;
$actorDelete = Cache::remember($key, now()->addMinutes(15), function() use($actor) { $actorDelete = Cache::remember($key, now()->addMinutes(15), function() use($actor) {
@ -89,7 +90,7 @@ class InboxValidator implements ShouldQueue
->exists(); ->exists();
}); });
if($actorDelete) { if($actorDelete) {
if($this->verifySignature($headers, $payload) == true) { if($this->verifySignature($headers, $profile, $payload) == true) {
Cache::set($key, false); Cache::set($key, false);
$profile = Profile::whereNotNull('domain') $profile = Profile::whereNotNull('domain')
->whereNull('status') ->whereNull('status')