forked from mirror/pixelfed
Update AP Inbox
This commit is contained in:
parent
36b88901f3
commit
31fc65fc74
|
@ -69,16 +69,8 @@ class DeleteWorker implements ShouldQueue
|
|||
))
|
||||
) {
|
||||
$actor = $payload['actor'];
|
||||
$hash = strlen($actor) <= 48 ?
|
||||
'b:' . base64_encode($actor) :
|
||||
'h:' . hash('sha256', $actor);
|
||||
|
||||
$key = 'ap:inbox:actor-delete-exists:' . $hash;
|
||||
$actorDelete = Cache::remember($key, now()->addMinutes(15), function() use($actor) {
|
||||
return Profile::whereRemoteUrl($actor)
|
||||
->whereNotNull('domain')
|
||||
->exists();
|
||||
});
|
||||
if($this->verifySignature($headers, $payload) == true) {
|
||||
$actorDelete = Profile::whereRemoteUrl($actor)->exists();
|
||||
if($actorDelete) {
|
||||
if($this->verifySignature($headers, $payload) == true) {
|
||||
Cache::set($key, false);
|
||||
|
@ -99,19 +91,23 @@ class DeleteWorker implements ShouldQueue
|
|||
return 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
$profile = null;
|
||||
|
||||
if($this->verifySignature($headers, $payload) == true) {
|
||||
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('inbox');
|
||||
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('delete');
|
||||
return 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function verifySignature($headers, $payload)
|
||||
{
|
||||
$body = $this->payload;
|
||||
|
|
Loading…
Reference in New Issue