From 6fb868634e5da1e67829b08a10aeffd232d9db70 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Tue, 5 Dec 2023 18:48:56 +0530 Subject: [PATCH] Refactored presence file for handling on Presence --- lib/src/main/java/io/ably/lib/realtime/Presence.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/main/java/io/ably/lib/realtime/Presence.java b/lib/src/main/java/io/ably/lib/realtime/Presence.java index b73fb5325..9f3d3a50e 100644 --- a/lib/src/main/java/io/ably/lib/realtime/Presence.java +++ b/lib/src/main/java/io/ably/lib/realtime/Presence.java @@ -335,7 +335,7 @@ private void endSync() { broadcastPresence(residualMembers); } - private void updateInnerMessageFields(ProtocolMessage message) { + private void updateInnerPresenceMessageFields(ProtocolMessage message) { for(int i = 0; i < message.presence.length; i++) { PresenceMessage msg = message.presence[i]; try { @@ -386,7 +386,7 @@ void onSync(ProtocolMessage protocolMessage) { } void onPresence(ProtocolMessage protocolMessage) { - updateInnerMessageFields(protocolMessage); + updateInnerPresenceMessageFields(protocolMessage); List updatedPresenceMessages = new ArrayList<>(); for(PresenceMessage presenceMessage : protocolMessage.presence) { boolean updateInternalPresence = presenceMessage.connectionId.equals(channel.ably.connection.id); @@ -396,9 +396,9 @@ void onPresence(ProtocolMessage protocolMessage) { case enter: case update: case present: - PresenceMessage shallowClone = (PresenceMessage)presenceMessage.clone(); - shallowClone.action = PresenceMessage.Action.present; - memberUpdated = presence.put(shallowClone); + PresenceMessage shallowPresenceCopy = (PresenceMessage)presenceMessage.clone(); + shallowPresenceCopy.action = PresenceMessage.Action.present; + memberUpdated = presence.put(shallowPresenceCopy); if(updateInternalPresence) internalPresence.put(presenceMessage); break;