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.

13 lines
325 B

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