diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-04-28 18:16:42 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-04-28 18:16:42 +0200 |
commit | f23f784f1811a5e7ae82faaf8868e389e9608f5d (patch) | |
tree | 77b919683a8656a361d7d62c8745233bc8b2d310 /app/services/fan_out_on_write_service.rb | |
parent | 6a9d1549484a6fb02d7d01e884577a7185302046 (diff) | |
parent | 8284110c55679b7ce7b3922cb0559620b03ca88c (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index f182cb83e..9d6d7e784 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class FanOutOnWriteService < BaseService + include Redisable + # Push a status into home and mentions feeds # @param [Status] status # @param [Hash] options @@ -107,20 +109,20 @@ class FanOutOnWriteService < BaseService def broadcast_to_hashtag_streams! @status.tags.pluck(:name).each do |hashtag| - Redis.current.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}", anonymous_payload) - Redis.current.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}:local", anonymous_payload) if @status.local? + redis.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}", anonymous_payload) + redis.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}:local", anonymous_payload) if @status.local? end end def broadcast_to_public_streams! return if @status.reply? && @status.in_reply_to_account_id != @account.id && !Setting.show_replies_in_public_timelines - Redis.current.publish('timeline:public', anonymous_payload) - Redis.current.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', anonymous_payload) + redis.publish('timeline:public', anonymous_payload) + redis.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', anonymous_payload) if @status.with_media? - Redis.current.publish('timeline:public:media', anonymous_payload) - Redis.current.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', anonymous_payload) + redis.publish('timeline:public:media', anonymous_payload) + redis.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', anonymous_payload) end end |