2016-11-15 10:56:29 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-05 10:20:05 -04:00
|
|
|
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
|