Skip to content

Commit

Permalink
Enforce RTP6c attach rule for presence.
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Jul 6, 2024
1 parent d1458ad commit 4aea29f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/ARTRealtimePresence.m
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ - (ARTEventListener *)subscribeWithAttachCallback:(ARTCallback)onAttach callback
if (onAttach) onAttach([ARTErrorInfo createWithCode:ARTErrorChannelOperationFailedInvalidState message:@"attempted to subscribe while channel is in Failed state."]);
return;
}
[self->_channel _attach:onAttach];
if (self->_channel.shouldAttach) { // RTP6c
[self->_channel _attach:onAttach];
}
listener = [_eventEmitter on:cb];
ARTLogVerbose(self.logger, @"R:%p C:%p (%@) presence subscribe to all actions", self->_realtime, self->_channel, self->_channel.name);
});
Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
- (ARTErrorInfo *)errorReason_nosync;
- (NSString * _Nullable)clientId_nosync;
- (BOOL)canBeReattached;
- (BOOL)shouldAttach;

@property (readonly, weak, nonatomic) ARTRealtimeInternal *realtime; // weak because realtime owns self
@property (readonly, nonatomic) ARTRestChannelInternal *restChannel;
Expand Down

0 comments on commit 4aea29f

Please sign in to comment.