about summary refs log tree commit diff
path: root/app/channels/public_channel.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-05 15:20:05 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-05 17:13:14 +0100
commit48b9619439818ecb344ae33c9c31a55ecb1aa27a (patch)
treeef350e3ebf2563adbe4d57778a08f561d912415f /app/channels/public_channel.rb
parent62292797eccc5bcf47abae9f4daaa2c186660644 (diff)
Adding hashtags
Diffstat (limited to 'app/channels/public_channel.rb')
-rw-r--r--app/channels/public_channel.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/channels/public_channel.rb b/app/channels/public_channel.rb
index 708eff055..41e21611d 100644
--- a/app/channels/public_channel.rb
+++ b/app/channels/public_channel.rb
@@ -1,19 +1,9 @@
-# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
 class PublicChannel < ApplicationCable::Channel
   def subscribed
     stream_from 'timeline:public', lambda { |encoded_message|
-      message = ActiveSupport::JSON.decode(encoded_message)
-
-      status = Status.find_by(id: message['id'])
-      next if status.nil? || current_user.account.blocking?(status.account) || (status.reblog? && current_user.account.blocking?(status.reblog.account))
-
-      message['message'] = FeedManager.instance.inline_render(current_user.account, status)
-
+      status, message = hydrate_status(encoded_message)
+      next if filter?(status)
       transmit message
     }
   end
-
-  def unsubscribed
-    # Any cleanup needed when channel is unsubscribed
-  end
 end