about summary refs log tree commit diff
path: root/app/controllers/directories_controller.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-08-30 13:38:41 +0200
committerThibaut Girka <thib@sitedethib.com>2019-08-30 13:38:41 +0200
commit9044a2b051da18e9f70fd4fae55c2bd232891d1f (patch)
tree0bf32b0fa0e854f75e50c1dee05ec41f6b301bf4 /app/controllers/directories_controller.rb
parent2848c08953a8555e06791170dbf1090575e05d8a (diff)
parent49f57b55346f8e62d21a3c8bc63301038ecb796f (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/views/directories/index.html.haml
  Upstream has redesigned the profile directory, and we
  had a glitch-soc-specific change to hide follower counts.
  Ported that change to the new design.
Diffstat (limited to 'app/controllers/directories_controller.rb')
-rw-r--r--app/controllers/directories_controller.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/directories_controller.rb b/app/controllers/directories_controller.rb
index f2d1f5661..bbfdde8af 100644
--- a/app/controllers/directories_controller.rb
+++ b/app/controllers/directories_controller.rb
@@ -7,7 +7,6 @@ class DirectoriesController < ApplicationController
   before_action :require_enabled!
   before_action :set_instance_presenter
   before_action :set_tag, only: :show
-  before_action :set_tags
   before_action :set_accounts
   before_action :set_pack
 
@@ -33,13 +32,10 @@ class DirectoriesController < ApplicationController
     @tag = Tag.discoverable.find_normalized!(params[:id])
   end
 
-  def set_tags
-    @tags = Tag.discoverable.limit(30).reject { |tag| tag.cached_sample_accounts.empty? }
-  end
-
   def set_accounts
-    @accounts = Account.discoverable.by_recent_status.page(params[:page]).per(40).tap do |query|
+    @accounts = Account.local.discoverable.by_recent_status.page(params[:page]).per(20).tap do |query|
       query.merge!(Account.tagged_with(@tag.id)) if @tag
+      query.merge!(Account.not_excluded_by_account(current_account)) if current_account
     end
   end