You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
294 B

7 years ago
  1. class HashtagChannel < ApplicationCable::Channel
  2. def subscribed
  3. tag = params[:tag].downcase
  4. stream_from "timeline:hashtag:#{tag}", lambda { |encoded_message|
  5. status, message = hydrate_status(encoded_message)
  6. next if filter?(status)
  7. transmit message
  8. }
  9. end
  10. end