diff options
Diffstat (limited to 'app/channels/hashtag_channel.rb')
-rw-r--r-- | app/channels/hashtag_channel.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/channels/hashtag_channel.rb b/app/channels/hashtag_channel.rb new file mode 100644 index 000000000..5be8d94cd --- /dev/null +++ b/app/channels/hashtag_channel.rb @@ -0,0 +1,11 @@ +class HashtagChannel < ApplicationCable::Channel + def subscribed + tag = params[:tag].downcase + + stream_from "timeline:hashtag:#{tag}", lambda { |encoded_message| + status, message = hydrate_status(encoded_message) + next if filter?(status) + transmit message + } + end +end |