Class: CustomerServiceIm::MessagesChannel

Inherits:
ApplicationCable::Channel show all
Defined in:
app/channels/customer_service_im/messages_channel.rb

Instance Method Summary collapse

Instance Method Details

#subscribedObject



3
4
5
6
7
8
9
# File 'app/channels/customer_service_im/messages_channel.rb', line 3

def subscribed
  # stream_from "some_channel"
  current_user.online!

  conversation = Conversation.find(params[:conversation_id])
  stream_for conversation
end

#unsubscribedObject



11
12
13
# File 'app/channels/customer_service_im/messages_channel.rb', line 11

def unsubscribed
  # Any cleanup needed when channel is unsubscribed
end