about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/api/v1/timelines/public_controller.rb2
-rw-r--r--app/services/batched_remove_status_service.rb14
-rw-r--r--app/services/fan_out_on_write_service.rb14
-rw-r--r--app/services/remove_status_service.rb14
-rw-r--r--app/services/revoke_status_service.rb14
5 files changed, 17 insertions, 41 deletions
diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb
index b53f7750f..274392c61 100644
--- a/app/controllers/api/v1/timelines/public_controller.rb
+++ b/app/controllers/api/v1/timelines/public_controller.rb
@@ -42,7 +42,7 @@ class Api::V1::Timelines::PublicController < Api::BaseController
 
   def public_timeline_statuses
     local = truthy_param?(:local) ? true : :local_reblogs
-    Status.as_public_timeline(current_account, truthy_param?(:remote) ? :remote : local)
+    Status.as_public_timeline(current_account, truthy_param?(:remote) ? nil : local)
   end
 
   def insert_pagination_headers
diff --git a/app/services/batched_remove_status_service.rb b/app/services/batched_remove_status_service.rb
index 707672ee0..ef68dc5bc 100644
--- a/app/services/batched_remove_status_service.rb
+++ b/app/services/batched_remove_status_service.rb
@@ -73,18 +73,12 @@ class BatchedRemoveStatusService < BaseService
 
     redis.pipelined do
       redis.publish('timeline:public', payload)
-      if status.local?
-        redis.publish('timeline:public:local', payload)
-      else
-        redis.publish('timeline:public:remote', payload)
-      end
+      redis.publish('timeline:public:local', payload) if status.local?
+      redis.publish('timeline:public:remote', payload)
       if status.media_attachments.any?
         redis.publish('timeline:public:media', payload)
-        if status.local?
-          redis.publish('timeline:public:local:media', payload)
-        else
-          redis.publish('timeline:public:remote:media', payload)
-        end
+        redis.publish('timeline:public:local:media', payload) if status.local?
+        redis.publish('timeline:public:remote:media', payload)
       end
 
       @tags[status.id].each do |hashtag|
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 800e4aa07..5b5d2c0a1 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -102,11 +102,8 @@ class FanOutOnWriteService < BaseService
     Redis.current.set(key, 1, ex: 2.hours)
 
     Redis.current.publish('timeline:public', @payload) if status.local? || !tavern
-    if status.local?
-      Redis.current.publish('timeline:public:local', @payload)
-    else
-      Redis.current.publish('timeline:public:remote', @payload)
-    end
+    Redis.current.publish('timeline:public:local', @payload) if status.local?
+    Redis.current.publish('timeline:public:remote', @payload)
   end
 
   def deliver_to_media(status, tavern = false)
@@ -116,11 +113,8 @@ class FanOutOnWriteService < BaseService
     Rails.logger.debug "Delivering status #{status.id} to media timeline"
 
     Redis.current.publish('timeline:public:media', @payload) if status.local? || !tavern
-    if status.local?
-      Redis.current.publish('timeline:public:local:media', @payload)
-    else
-      Redis.current.publish('timeline:public:remote:media', @payload)
-    end
+    Redis.current.publish('timeline:public:local:media', @payload) if status.local?
+    Redis.current.publish('timeline:public:remote:media', @payload)
   end
 
   def deliver_to_direct_timelines(status)
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index 57120e38f..ca7f830ec 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -156,22 +156,16 @@ class RemoveStatusService < BaseService
     return unless @status.distributable?
 
     redis.publish('timeline:public', @payload)
-    if @status.local?
-      redis.publish('timeline:public:local', @payload)
-    else
-      redis.publish('timeline:public:remote', @payload)
-    end
+    redis.publish('timeline:public:local', @payload) if @status.local?
+    redis.publish('timeline:public:remote', @payload)
   end
 
   def remove_from_media
     return unless @status.distributable?
 
     redis.publish('timeline:public:media', @payload)
-    if @status.local?
-      redis.publish('timeline:public:local:media', @payload)
-    else
-      redis.publish('timeline:public:remote:media', @payload)
-    end
+    redis.publish('timeline:public:local:media', @payload) if @status.local?
+    redis.publish('timeline:public:remote:media', @payload)
   end
 
   def remove_from_direct
diff --git a/app/services/revoke_status_service.rb b/app/services/revoke_status_service.rb
index 95810acd2..f4762631c 100644
--- a/app/services/revoke_status_service.rb
+++ b/app/services/revoke_status_service.rb
@@ -74,22 +74,16 @@ class RevokeStatusService < BaseService
     return if @status.distributable?
 
     redis.publish('timeline:public', @payload)
-    if @status.local?
-      redis.publish('timeline:public:local', @payload)
-    else
-      redis.publish('timeline:public:remote', @payload)
-    end
+    redis.publish('timeline:public:local', @payload) if @status.local?
+    redis.publish('timeline:public:remote', @payload)
   end
 
   def remove_from_media
     return if @status.distributable?
 
     redis.publish('timeline:public:media', @payload)
-    if @status.local?
-      redis.publish('timeline:public:local:media', @payload)
-    else
-      redis.publish('timeline:public:remote:media', @payload)
-    end
+    redis.publish('timeline:public:local:media', @payload) if @status.local?
+    redis.publish('timeline:public:remote:media', @payload)
   end
 
   def remove_from_direct