diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index a2948438b..12bfb2d6e 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -26,15 +26,17 @@ class FanOutOnWriteService < BaseService return if status.account.silenced? if status.reblog? - return deliver_to_public(status.reblog) if status.local? && status.reblog.public_visibility? && !status.reblog.account.silenced? - + if status.local? && status.reblog.public_visibility? && !status.reblog.account.silenced? + deliver_to_public(status.reblog) + deliver_to_media(status.reblog) if status.reblog.media_attachments.any? + end return end deliver_to_hashtags(status) if status.distributable? return if !status.public_visibility? || (status.reply? && status.in_reply_to_account_id != status.account_id) - deliver_to_media(status) if status.media_attachments.any? + deliver_to_media(status, true) if status.media_attachments.any? deliver_to_public(status, true) end @@ -104,10 +106,13 @@ class FanOutOnWriteService < BaseService end end - def deliver_to_media(status) + def deliver_to_media(status, tavern = false) + key = "timeline:public:#{status.id}" + return if Redis.current.get(key) + Rails.logger.debug "Delivering status #{status.id} to media timeline" - Redis.current.publish('timeline:public:media', @payload) + Redis.current.publish('timeline:public:media', @payload) if status.local? || !tavern if status.local? Redis.current.publish('timeline:public:local:media', @payload) else |