about summary refs log tree commit diff
path: root/app/channels/application_cable
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-02 00:39:17 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-02 00:39:17 +0100
commitede04cdb2443fe87a30b393c8dd2a5973dc05770 (patch)
tree90701ce7738001adfa8ef04c929027784f37dbb6 /app/channels/application_cable
parentd9ca46b464dc5a5eb0ad308809c15a79dcd17ada (diff)
Move rendering of JSON payloads for public/hashtag timelines to
FanOutOnWriteService. The only recipient-specific part on them
is reblogged/favourited. But since only newly created statuses
appear on them, it is safe to assume that both attributes would
be false
Diffstat (limited to 'app/channels/application_cable')
-rw-r--r--app/channels/application_cable/channel.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb
index ae69032ce..f57bcc56a 100644
--- a/app/channels/application_cable/channel.rb
+++ b/app/channels/application_cable/channel.rb
@@ -5,12 +5,12 @@ module ApplicationCable
     protected
 
     def hydrate_status(encoded_message)
-      message = ActiveSupport::JSON.decode(encoded_message)
+      message = OJ.load(encoded_message)
 
       return [nil, message] if message['event'] == 'delete'
 
-      status             = Status.find_by(id: message['payload'])
-      message['payload'] = FeedManager.instance.inline_render(current_user.account, 'api/v1/statuses/show', status)
+      status_json = OJ.load(message['payload'])
+      status      = Status.find(status_json['id'])
 
       [status, message]
     end