Chatwoot/app/channels/room_channel.rb
Pranav Raj S 0b31e14132
Feature: Add online status to each user (#452)
* Feature: Add online status to each user
* Add OnlineStatusable, add availability status to thumbnail
2020-02-02 22:49:16 +05:45

10 lines
272 B
Ruby

class RoomChannel < ApplicationCable::Channel
def subscribed
stream_from params[:pubsub_token]
::OnlineStatusTracker.add_subscription(params[:pubsub_token])
end
def unsubscribed
::OnlineStatusTracker.remove_subscription(params[:pubsub_token])
end
end