hashtag->id; } /** * Get the middleware the job should pass through. * * @return array */ public function middleware(): array { return [(new WithoutOverlapping("hfp:hashtag:fanout:insert:{$this->hashtag->id}"))->shared()->dontRelease()]; } /** * Create a new job instance. */ public function __construct(StatusHashtag $hashtag) { $this->hashtag = $hashtag; } /** * Execute the job. */ public function handle(): void { $hashtag = $this->hashtag; $sid = $hashtag->status_id; $status = StatusService::get($sid, false); if(!$status) { return; } if(!in_array($status['pf_type'], ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])) { return; } $skipIds = UserFilter::whereFilterableType('App\Profile')->whereFilterableId($status['account']['id'])->whereIn('filter_type', ['mute', 'block'])->pluck('user_id')->toArray(); $ids = HashtagFollowService::getPidByHid($hashtag->hashtag_id); if(!$ids || !count($ids)) { return; } foreach($ids as $id) { if(!in_array($id, $skipIds)) { HomeTimelineService::add($id, $hashtag->status_id); } } } }