diff options
author | VirtuBox <contact@virtubox.net> | 2017-04-06 19:11:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-06 19:11:39 +0200 |
commit | c441208e29cc86cbf514851879bdaa9130351b22 (patch) | |
tree | f2553a71516f4c33db5d241fb46a1d84e1a3380c /app/services/fan_out_on_write_service.rb | |
parent | 28fb01c71aea96e66bc639917206f5472ca2d34f (diff) | |
parent | 5e6382891706199ade801cd6337069b7d6f307cb (diff) |
Merge branch 'master' into patch-1
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index 106d257ba..19eedc0a7 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -50,22 +50,23 @@ class FanOutOnWriteService < BaseService end def render_anonymous_payload(status) - @payload = FeedManager.instance.inline_render(nil, 'api/v1/statuses/show', status) + @payload = InlineRenderer.render(status, nil, 'api/v1/statuses/show') + @payload = Oj.dump(event: :update, payload: @payload) end def deliver_to_hashtags(status) Rails.logger.debug "Delivering status #{status.id} to hashtags" status.tags.pluck(:name).each do |hashtag| - FeedManager.instance.broadcast("hashtag:#{hashtag}", event: 'update', payload: @payload) - FeedManager.instance.broadcast("hashtag:#{hashtag}:local", event: 'update', payload: @payload) if status.account.local? + Redis.current.publish("timeline:hashtag:#{hashtag}", @payload) + Redis.current.publish("timeline:hashtag:#{hashtag}:local", @payload) if status.local? end end def deliver_to_public(status) Rails.logger.debug "Delivering status #{status.id} to public timeline" - FeedManager.instance.broadcast(:public, event: 'update', payload: @payload) - FeedManager.instance.broadcast('public:local', event: 'update', payload: @payload) if status.account.local? + Redis.current.publish('timeline:public', @payload) + Redis.current.publish('timeline:public:local', @payload) if status.local? end end |