about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/timelines/home_controller.rb2
-rw-r--r--app/controllers/api/v1/timelines/list_controller.rb2
-rw-r--r--app/controllers/settings/preferences_controller.rb4
-rw-r--r--app/models/status.rb8
-rw-r--r--app/models/user.rb12
-rw-r--r--app/views/settings/preferences/show.html.haml4
6 files changed, 12 insertions, 20 deletions
diff --git a/app/controllers/api/v1/timelines/home_controller.rb b/app/controllers/api/v1/timelines/home_controller.rb
index 01d4e3360..bd3bac0fe 100644
--- a/app/controllers/api/v1/timelines/home_controller.rb
+++ b/app/controllers/api/v1/timelines/home_controller.rb
@@ -23,7 +23,7 @@ class Api::V1::Timelines::HomeController < Api::BaseController
   end
 
   def cached_home_statuses
-    if current_account&.user&.hides_boosts?
+    if current_account&.user&.hide_boosts
       cache_collection home_statuses.without_reblogs, Status
     else
       cache_collection home_statuses, Status
diff --git a/app/controllers/api/v1/timelines/list_controller.rb b/app/controllers/api/v1/timelines/list_controller.rb
index 15934adb3..7eb656745 100644
--- a/app/controllers/api/v1/timelines/list_controller.rb
+++ b/app/controllers/api/v1/timelines/list_controller.rb
@@ -25,7 +25,7 @@ class Api::V1::Timelines::ListController < Api::BaseController
   end
 
   def cached_list_statuses
-    if current_account&.user&.hides_boosts?
+    if current_account&.user&.hide_boosts
       cache_collection list_statuses.without_reblogs, Status
     else
       cache_collection list_statuses, Status
diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb
index 3ea166c31..66e9033d3 100644
--- a/app/controllers/settings/preferences_controller.rb
+++ b/app/controllers/settings/preferences_controller.rb
@@ -27,6 +27,8 @@ class Settings::PreferencesController < Settings::BaseController
   def user_params
     params.require(:user).permit(
       :locale,
+      :hide_boosts,
+      :only_known,
       chosen_languages: []
     )
   end
@@ -51,8 +53,6 @@ class Settings::PreferencesController < Settings::BaseController
       :setting_hide_mntions_blocked,
       :setting_hide_mntions_blocker,
       :setting_hide_mntions_packm8,
-      :setting_hide_boosts,
-      :setting_only_known,
       :setting_gently_kobolds,
       :setting_user_is_kobold,
       :setting_hide_mascot,
diff --git a/app/models/status.rb b/app/models/status.rb
index 8f618ed31..8a1680ccf 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -393,7 +393,7 @@ class Status < ApplicationRecord
 
     def as_home_timeline(account)
       query = where(account: [account] + account.following, visibility: [:public, :unlisted, :local, :private])
-      query = query.without_reblogs if account.present? && account&.user&.hides_boosts?
+      query = query.without_reblogs if account.present? && account&.user&.hide_boosts
       query
     end
 
@@ -448,8 +448,8 @@ class Status < ApplicationRecord
       query = query.without_replies unless Setting.show_replies_in_public_timelines
 
       if account.present? && account.local?
-        query = query.without_reblogs if account&.user&.hides_boosts?
-        query = query.only_followers_of(account) if account&.user&.shows_only_known?
+        query = query.without_reblogs if account&.user&.hide_boosts
+        query = query.only_followers_of(account) if account&.user&.only_known
       end
 
       apply_timeline_filters(query, account, local_only)
@@ -457,7 +457,7 @@ class Status < ApplicationRecord
 
     def as_tag_timeline(tag, account = nil, local_only = false, priv = false)
       query = tag_timeline_scope(account, local_only, priv).tagged_with(tag)
-      query = query.only_followers_of(account) if account.present? && account.local? && account&.user&.shows_only_known?
+      query = query.only_followers_of(account) if account.present? && account.local? && account&.user&.only_known?
       apply_timeline_filters(query, account, local_only, true)
     end
 
diff --git a/app/models/user.rb b/app/models/user.rb
index afea5be6d..59067cb36 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -39,6 +39,8 @@
 #  created_by_application_id :bigint(8)
 #  approved                  :boolean          default(TRUE), not null
 #  vars                      :jsonb            not null
+#  hide_boosts               :boolean
+#  only_known                :boolean
 #
 
 class User < ApplicationRecord
@@ -132,8 +134,6 @@ class User < ApplicationRecord
     :hide_mntions_blocker,
     :hide_mntions_packm8,
     :hide_mascot,
-    :hide_boosts,
-    :only_known,
     :hide_interactions,
     :hide_public_profile,
     :hide_public_outbox,
@@ -307,14 +307,6 @@ class User < ApplicationRecord
     @hides_mascot ||= (settings.hide_mascot || false)
   end
 
-  def hides_boosts?
-    @hides_boosts ||= (settings.hide_boosts || false)
-  end
-
-  def shows_only_known?
-    @only_known ||= (settings.only_known || false)
-  end
-
   def hides_interactions?
     @hides_interactions ||= (settings.hide_interactions || false)
   end
diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml
index f45d66724..81bfc7345 100644
--- a/app/views/settings/preferences/show.html.haml
+++ b/app/views/settings/preferences/show.html.haml
@@ -47,8 +47,8 @@
 
   .fields-group
     = f.input :setting_rawr_federated, as: :boolean, wrapper: :with_label
-    = f.input :setting_hide_boosts, as: :boolean, wrapper: :with_label
-    = f.input :setting_only_known, as: :boolean, wrapper: :with_label
+    = f.input :hide_boosts, as: :boolean, wrapper: :with_label
+    = f.input :only_known, as: :boolean, wrapper: :with_label
 
   %hr/