about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-05-10 17:36:18 +0900
committerGitHub <noreply@github.com>2020-05-10 10:36:18 +0200
commit26b08a3c54847f2816f78c3ac67ace001d3fea1f (patch)
tree9512f3ec81de5bd70b4b544475c84aecf1a58110 /app/models
parente9ecbca70d28c775a9eeda7670e06443a1037d5b (diff)
Add remote only to public timeline (#13504)
* Add remote only to public timeline

* Fix code style
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 8c7fe8dfa..a1babf85e 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -284,7 +284,7 @@ class Status < ApplicationRecord
     def as_public_timeline(account = nil, local_only = false)
       query = timeline_scope(local_only).without_replies
 
-      apply_timeline_filters(query, account, local_only)
+      apply_timeline_filters(query, account, [:local, true].include?(local_only))
     end
 
     def as_tag_timeline(tag, account = nil, local_only = false)
@@ -376,8 +376,16 @@ class Status < ApplicationRecord
 
     private
 
-    def timeline_scope(local_only = false)
-      starting_scope = local_only ? Status.local : Status
+    def timeline_scope(scope = false)
+      starting_scope = case scope
+                       when :local, true
+                         Status.local
+                       when :remote
+                         Status.remote
+                       else
+                         Status
+                       end
+
       starting_scope
         .with_public_visibility
         .without_reblogs