From 7295b1b887744d6f788db5b227c9a93cafffdac4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 26 Feb 2019 00:30:54 -0700 Subject: [PATCH] Update StatusPipeline --- app/Jobs/StatusPipeline/NewStatusPipeline.php | 12 +----------- app/Jobs/StatusPipeline/StatusEntityLexer.php | 10 +++++++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/Jobs/StatusPipeline/NewStatusPipeline.php b/app/Jobs/StatusPipeline/NewStatusPipeline.php index 2ba51114d..0b392639b 100644 --- a/app/Jobs/StatusPipeline/NewStatusPipeline.php +++ b/app/Jobs/StatusPipeline/NewStatusPipeline.php @@ -41,16 +41,6 @@ class NewStatusPipeline implements ShouldQueue */ public function handle() { - $status = $this->status; - - StatusEntityLexer::dispatch($status); - - if(config('pixelfed.activitypub_enabled') == true) { - StatusActivityPubDeliver::dispatch($status); - } - - // Cache::forever('post.'.$status->id, $status); - // $redis = Redis::connection(); - // $redis->lpush(config('cache.prefix').':user.'.$status->profile_id.'.posts', $status->id); + StatusEntityLexer::dispatch($this->status); } } diff --git a/app/Jobs/StatusPipeline/StatusEntityLexer.php b/app/Jobs/StatusPipeline/StatusEntityLexer.php index 72cd0394c..5fe3cf34a 100644 --- a/app/Jobs/StatusPipeline/StatusEntityLexer.php +++ b/app/Jobs/StatusPipeline/StatusEntityLexer.php @@ -75,7 +75,6 @@ class StatusEntityLexer implements ShouldQueue public function storeEntities() { $this->storeHashtags(); - $this->storeMentions(); DB::transaction(function () { $status = $this->status; $status->rendered = nl2br($this->autolink); @@ -100,6 +99,7 @@ class StatusEntityLexer implements ShouldQueue ); }); } + $this->storeMentions(); } public function storeMentions() @@ -123,5 +123,13 @@ class StatusEntityLexer implements ShouldQueue MentionPipeline::dispatch($status, $m); }); } + $this->deliver(); + } + + public function deliver() + { + if(config('pixelfed.activitypub_enabled') == true) { + StatusActivityPubDeliver::dispatch($this->status); + } } }