about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb42
-rw-r--r--app/models/user.rb6
2 files changed, 28 insertions, 20 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 37eae21aa..f8c11d109 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -351,25 +351,29 @@ class Status < ApplicationRecord
     end
 
     def as_public_timeline(account = nil, local_only = false)
-      # instead of our ftl being a noisy irrelevant firehose
-      # only show public stuff boosted by the community
-      query = Status.network
-      if local_only then
-        # we don't want to change the ltl
-        query = query
-          .with_public_visibility
-          .without_replies
-          .without_reblogs
-      else # but on the ftl
-        query = query.without_replies unless Setting.show_replies_in_public_timelines
-        # grab the stuff we boosted
-        subquery = query.reblogs.select(:reblog_of_id)
-          .reorder(nil)
-          .distinct
-        # map those ids to actual statuses
-        # THIS QUERY IS EXPENSIVE AS FUCK!!!!!!!
-        # but it does the job
-        query = Status.where(id: subquery).with_public_visibility
+      if account.present? && account&.user&.setting_rawr_federated
+        query = timeline_scope(local_only).without_replies
+      else
+        # instead of our ftl being a noisy irrelevant firehose
+        # only show public stuff boosted by the community
+        query = Status.network
+        if local_only then
+          # we don't want to change the ltl
+          query = query
+            .with_public_visibility
+            .without_replies
+            .without_reblogs
+        else # but on the ftl
+          query = query.without_replies unless Setting.show_replies_in_public_timelines
+          # grab the stuff we boosted
+          subquery = query.reblogs.select(:reblog_of_id)
+            .reorder(nil)
+            .distinct
+          # map those ids to actual statuses
+          # THIS QUERY IS EXPENSIVE AS FUCK!!!!!!!
+          # but it does the job
+          query = Status.where(id: subquery).with_public_visibility
+        end
       end
 
       apply_timeline_filters(query, account, local_only)
diff --git a/app/models/user.rb b/app/models/user.rb
index ebf3fa422..b581a9a4b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -102,7 +102,7 @@ class User < ApplicationRecord
 
   has_many :session_activations, dependent: :destroy
 
-  delegate :auto_play_gif, :default_local, :always_local, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
+  delegate :auto_play_gif, :default_local, :always_local, :rawr_federated, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
            :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_media, :hide_network, :hide_followers_count,
            :expand_spoilers, :default_language, :aggregate_reblogs, :show_application, :default_content_type, to: :settings, prefix: :setting, allow_nil: false
 
@@ -196,6 +196,10 @@ class User < ApplicationRecord
     settings.always_local || false
   end
 
+  def setting_rawr_federated
+    settings.rawr_federated || false
+  end
+
   def allows_digest_emails?
     settings.notification_emails['digest']
   end