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
This commit is contained in:
Eugen Rochko
2017-02-02 00:39:17 +01:00
parent d9ca46b464
commit ede04cdb24
2 changed files with 5 additions and 5 deletions

View File

@ -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