Module: RocketChat::Realtime::Subscriptions::Room

Included in:
Client
Defined in:
lib/rocket_chat/realtime/subscriptions/room.rb

Overview

Room Subscriptions

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#subscribe_room_messages(room_id) ⇒ Object

Subscribe to room messages

Parameters:

  • room_id (String)

Since:

  • 0.1.0



17
18
19
20
21
22
23
24
25
26
# File 'lib/rocket_chat/realtime/subscriptions/room.rb', line 17

def subscribe_room_messages(room_id)
  subscription = Messages::Subscribe.new(
    'stream-room-messages',
    room_id,
    false
  )
  AsyncTask.start(subscription.id) do
    driver.text(subscription.to_json)
  end
end