Skip to content

Commit

Permalink
Backport #22, fixes #23 for Flarum beta 13
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkwinkelmann committed Jan 2, 2021
1 parent 83388f5 commit b25f6da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Listeners/HideDiscussionsInIgnoredTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ public function handle(Searching $event)
$db = $event->search->getQuery()->getConnection();

$event->search->getQuery()
->whereNotExists(function ($query) use ($db, $user) {
return $query->selectRaw('1')
->whereNotIn('discussions.id', function ($query) use ($user) {
return $query->select('discussion_id')
->from('discussion_tag')
->whereIn('tag_id', function ($query) use ($db, $user) {
->whereIn('tag_id', function ($query) use ($user) {
$query
->select($db->raw(1))
->select('tag_id')
->from((new TagState())->getTable())
->where('user_id', $user->id)
->where('subscription', 'hide');
})
->whereColumn('discussions.id', 'discussion_id');
});
});
}
}

0 comments on commit b25f6da

Please sign in to comment.