lib/submodules/ably-ruby/lib/ably/realtime/presence/members_map.rb in ably-rest-1.0.6 vs lib/submodules/ably-ruby/lib/ably/realtime/presence/members_map.rb in ably-rest-1.1.0

- old
+ new

@@ -273,11 +273,11 @@ presence.enter_client(local_client_id, presence_message.data).tap do |deferrable| deferrable.errback do |error| presence_message_client_id = presence_message.client_id || client.auth.client_id re_enter_error = Ably::Models::ErrorInfo.new( message: "unable to automatically re-enter presence channel for client_id '#{presence_message_client_id}'. Source error code #{error.code} and message '#{error.message}'", - code: 91004 + code: Ably::Exceptions::Codes::UNABLE_TO_AUTOMATICALLY_REENTER_PRESENCE_CHANNEL ) channel.emit :update, Ably::Models::ChannelStateChange.new( current: channel.state, previous: channel.state, event: Ably::Realtime::Channel::EVENT(:update), @@ -310,17 +310,17 @@ when Ably::Models::PresenceMessage::ACTION.Enter, Ably::Models::PresenceMessage::ACTION.Update, Ably::Models::PresenceMessage::ACTION.Present add_presence_member presence_message when Ably::Models::PresenceMessage::ACTION.Leave remove_presence_member presence_message else - Ably::Exceptions::ProtocolError.new("Protocol error, unknown presence action #{presence_message.action}", 400, 80013) + Ably::Exceptions::ProtocolError.new("Protocol error, unknown presence action #{presence_message.action}", 400, Ably::Exceptions::Codes::PROTOCOL_ERROR) end end def ensure_presence_message_is_valid(presence_message) return true if presence_message.connection_id - error = Ably::Exceptions::ProtocolError.new("Protocol error, presence message is missing connectionId", 400, 80013) + error = Ably::Exceptions::ProtocolError.new("Protocol error, presence message is missing connectionId", 400, Ably::Exceptions::Codes::PROTOCOL_ERROR) logger.error { "PresenceMap: On channel '#{channel.name}' error: #{error}" } end # If the message received is older than the last known event for presence # then skip (return false). This can occur during a SYNC operation. For example: