1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Merge pull request #4005 from pixelfed/staging

Update AP Inbox
This commit is contained in:
daniel 2022-12-24 05:35:52 -07:00 committed by GitHub
commit 80bef4ecc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
@ -87,7 +79,7 @@ class DeleteWorker implements ShouldQueue
->whereRemoteUrl($actor)
->first();
if($profile) {
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('delete');
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('inbox');
}
return 1;
} else {
@ -99,9 +91,11 @@ class DeleteWorker implements ShouldQueue
return 1;
}
return 1;
} else {
return 1;
}
} else {
$profile = null;
if($this->verifySignature($headers, $payload) == true) {
@ -112,6 +106,8 @@ class DeleteWorker implements ShouldQueue
}
}
}
protected function verifySignature($headers, $payload)
{
$body = $this->payload;