From f62d2494a494a1a3bab9aa70257b22e5f43d91c4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 13 Dec 2022 00:46:25 -0700 Subject: [PATCH] Update InboxPipeline, dispatch Follow/Accept Follow jobs to follow queue --- app/Jobs/InboxPipeline/InboxValidator.php | 6 ++- app/Jobs/InboxPipeline/SharedInboxWorker.php | 43 -------------------- 2 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 app/Jobs/InboxPipeline/SharedInboxWorker.php diff --git a/app/Jobs/InboxPipeline/InboxValidator.php b/app/Jobs/InboxPipeline/InboxValidator.php index 9d2bb61b..21c43612 100644 --- a/app/Jobs/InboxPipeline/InboxValidator.php +++ b/app/Jobs/InboxPipeline/InboxValidator.php @@ -78,7 +78,11 @@ class InboxValidator implements ShouldQueue } if($this->verifySignature($headers, $profile, $payload) == true) { - ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('inbox'); + if(isset($payload['type']) && in_array($payload['type'], ['Follow', 'Accept']) ) { + ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('follow'); + } else { + ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('inbox'); + } return; } else { return; diff --git a/app/Jobs/InboxPipeline/SharedInboxWorker.php b/app/Jobs/InboxPipeline/SharedInboxWorker.php deleted file mode 100644 index 42391958..00000000 --- a/app/Jobs/InboxPipeline/SharedInboxWorker.php +++ /dev/null @@ -1,43 +0,0 @@ -request = $request; - $this->payload = $payload; - } - - /** - * Execute the job. - * - * @return void - */ - public function handle() - { - (new Inbox($this->request, null, $this->payload))->handleSharedInbox(); - } -}