about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/accounts_controller.rb6
-rw-r--r--app/controllers/settings/preferences/privacy_controller.rb9
-rw-r--r--app/controllers/settings/preferences_controller.rb1
3 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index 232a5fc71..d648e1a08 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -43,7 +43,7 @@ class AccountsController < ApplicationController
       end
 
       format.rss do
-        return forbidden if unauthorized?
+        return render xml: '', status: 404 if rss_disabled? || unauthorized?
 
         expires_in 1.minute, public: !current_account?
 
@@ -198,4 +198,8 @@ class AccountsController < ApplicationController
   def unauthorized?
     @unauthorized ||= blocked? || (@account.private? && !following?(@account))
   end
+
+  def rss_disabled?
+    current_user.setting_rss_disabled
+  end
 end
diff --git a/app/controllers/settings/preferences/privacy_controller.rb b/app/controllers/settings/preferences/privacy_controller.rb
new file mode 100644
index 000000000..f447fa598
--- /dev/null
+++ b/app/controllers/settings/preferences/privacy_controller.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class Settings::Preferences::PrivacyController < Settings::PreferencesController
+  private
+
+  def after_update_redirect_path
+    settings_preferences_privacy_path
+  end
+end
diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb
index ddbf89665..bbfd82869 100644
--- a/app/controllers/settings/preferences_controller.rb
+++ b/app/controllers/settings/preferences_controller.rb
@@ -77,6 +77,7 @@ class Settings::PreferencesController < Settings::BaseController
       :setting_filter_to_unknown,
       :setting_filter_from_unknown,
       :setting_unpublish_on_delete,
+      :setting_rss_disabled,
       notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account trending_tag),
       interactions: %i(must_be_follower must_be_following must_be_following_dm)
     )