lib/ably/realtime/client/incoming_message_dispatcher.rb in ably-0.8.7 vs lib/ably/realtime/client/incoming_message_dispatcher.rb in ably-0.8.8
- old
+ new
@@ -11,12 +11,18 @@
subscribe_to_incoming_protocol_messages
end
private
- attr_reader :client, :connection
+ def client
+ @client
+ end
+ def connection
+ @connection
+ end
+
def channels
client.channels
end
def get_channel(channel_name)
@@ -142,10 +148,11 @@
end
def process_connected_message(protocol_message)
if client.auth.token_client_id_allowed?(protocol_message.connection_details.client_id)
client.auth.configure_client_id protocol_message.connection_details.client_id
+ client.connection.set_connection_details protocol_message.connection_details
connection.transition_state_machine :connected, reason: protocol_message.error, protocol_message: protocol_message
else
reason = Ably::Exceptions::IncompatibleClientId.new("Client ID '#{protocol_message.connection_details.client_id}' specified by the server is incompatible with the library's configured client ID '#{client.client_id}'", 400, 40012)
connection.transition_state_machine :failed, reason: reason, protocol_message: protocol_message
end
@@ -193,10 +200,10 @@
end
end
def subscribe_to_incoming_protocol_messages
connection.__incoming_protocol_msgbus__.subscribe(:protocol_message) do |*args|
- dispatch_protocol_message *args
+ dispatch_protocol_message(*args)
end
end
end
end
end