diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-20 00:33:02 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-20 19:39:58 +0100 |
commit | da2ef4d676ff71e6ab3edf8d1a7cee8bf6b6d353 (patch) | |
tree | f73fa34a3323a70d5dcba360f781bce5325e3ed1 /app/lib | |
parent | 3838e6836d47797a4e8ca20afa70eebefb68da26 (diff) |
Adding unified streamable notifications
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/feed_manager.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index b808d7a0f..c8512476d 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -26,7 +26,7 @@ class FeedManager def push(timeline_type, account, status) redis.zadd(key(timeline_type, account.id), status.id, status.reblog? ? status.reblog_of_id : status.id) trim(timeline_type, account.id) - broadcast(account.id, type: 'update', timeline: timeline_type, message: inline_render(account, status)) + broadcast(account.id, type: 'update', timeline: timeline_type, message: inline_render(account, 'api/v1/statuses/show', status)) end def broadcast(timeline_id, options = {}) @@ -39,7 +39,7 @@ class FeedManager redis.zremrangebyscore(key(type, account_id), '-inf', "(#{last.last}") end - def inline_render(target_account, status) + def inline_render(target_account, template, object) rabl_scope = Class.new do include RoutingHelper @@ -56,7 +56,7 @@ class FeedManager end end - Rabl::Renderer.new('api/v1/statuses/show', status, view_path: 'app/views', format: :json, scope: rabl_scope.new(target_account)).render + Rabl::Renderer.new(template, object, view_path: 'app/views', format: :json, scope: rabl_scope.new(target_account)).render end private |