diff --git a/src/IO.Ably.Shared/Extensions/PresenceExtensions.cs b/src/IO.Ably.Shared/Extensions/PresenceExtensions.cs index f5f4f6b23..64c6f97dc 100644 --- a/src/IO.Ably.Shared/Extensions/PresenceExtensions.cs +++ b/src/IO.Ably.Shared/Extensions/PresenceExtensions.cs @@ -2,7 +2,7 @@ { internal static class PresenceExtensions { - public static bool IsSynthesized(this PresenceMessage msg) + public static bool IsServerSynthesized(this PresenceMessage msg) { return msg.Id == null || !msg.Id.StartsWith(msg.ConnectionId); } @@ -11,7 +11,7 @@ public static bool IsSynthesized(this PresenceMessage msg) public static bool IsNewerThan(this PresenceMessage existingMsg, PresenceMessage incomingMsg) { // RTP2b1 - if (existingMsg.IsSynthesized() || incomingMsg.IsSynthesized()) + if (existingMsg.IsServerSynthesized() || incomingMsg.IsServerSynthesized()) { return existingMsg.Timestamp > incomingMsg.Timestamp; } diff --git a/src/IO.Ably.Shared/Realtime/Presence.cs b/src/IO.Ably.Shared/Realtime/Presence.cs index 68784ae69..42358fd7c 100644 --- a/src/IO.Ably.Shared/Realtime/Presence.cs +++ b/src/IO.Ably.Shared/Realtime/Presence.cs @@ -596,7 +596,7 @@ internal void OnPresence(PresenceMessage[] messages) // RTP2e case PresenceAction.Leave: broadcast &= MembersMap.Remove(message); - if (updateInternalPresence && !message.IsSynthesized()) + if (updateInternalPresence && !message.IsServerSynthesized()) { InternalMembersMap.Remove(message); } diff --git a/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs b/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs index 2ba561ae9..c1926a260 100644 --- a/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs +++ b/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs @@ -636,7 +636,7 @@ await WaitForMultiple(2, partialDone => msgA = null; msgB = null; var synthesizedMsg = new PresenceMessage(PresenceAction.Leave, clientB.ClientId) { ConnectionId = null }; - synthesizedMsg.IsSynthesized().Should().BeTrue(); + synthesizedMsg.IsServerSynthesized().Should().BeTrue(); channelB.Presence.OnPresence(new[] { synthesizedMsg }); msgB.Should().BeNull();