about summary refs log tree commit diff
path: root/app/channels/public_channel.rb
blob: 9ef9e5dd733753ccbda5041fd33b502a690d3631 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

class PublicChannel < ApplicationCable::Channel
  def subscribed
    stream_from 'timeline:public', lambda { |encoded_message|
      status, message = hydrate_status(encoded_message)
      next if filter?(status)
      transmit message
    }
  end
end