about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-21 20:21:20 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-21 20:21:20 -0500
commitbca5a3073f3f6bee2c64f3e199e9e56d0dd7ff7e (patch)
tree748dc4ebe2704cedae2d54768927d8f43cd580a1 /app/controllers
parentd9073f132b041fae818ae3894503065de123f257 (diff)
privacy - add option to disable public activitypub outbox
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/activitypub/outboxes_controller.rb7
-rw-r--r--app/controllers/settings/preferences_controller.rb1
2 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/activitypub/outboxes_controller.rb b/app/controllers/activitypub/outboxes_controller.rb
index 438fa226e..3e617b10e 100644
--- a/app/controllers/activitypub/outboxes_controller.rb
+++ b/app/controllers/activitypub/outboxes_controller.rb
@@ -55,8 +55,11 @@ class ActivityPub::OutboxesController < Api::BaseController
 
   def set_statuses
     return unless page_requested?
-
-    @statuses = @account.statuses.permitted_for(@account, signed_request_account)
+    if @account&.user && @account.user.hides_public_outbox?
+      @statuses = Status.none
+    else
+      @statuses = @account.statuses.permitted_for(@account, signed_request_account)
+    end
     @statuses = params[:min_id].present? ? @statuses.paginate_by_min_id(LIMIT, params[:min_id]).reverse : @statuses.paginate_by_max_id(LIMIT, params[:max_id])
     @statuses = cache_collection(@statuses, Status)
   end
diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb
index 45bfd24b2..031075fcd 100644
--- a/app/controllers/settings/preferences_controller.rb
+++ b/app/controllers/settings/preferences_controller.rb
@@ -50,6 +50,7 @@ class Settings::PreferencesController < Settings::BaseController
       :setting_user_is_kobold,
       :setting_hide_mascot,
       :setting_hide_interactions,
+      :setting_hide_public_outbox,
       :setting_max_public_history,
 
       :setting_default_privacy,