Skip to content

Commit fabc448

Browse files
committed
Fix handling of session closed is not right
1 parent 4bd7203 commit fabc448

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

AVOS/AVOSCloudIM/Client/AVIMClient.m

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,24 +1016,20 @@ - (void)process_session_closed:(AVIMGenericCommand *)inCommand
10161016
self->_status = AVIMClientStatusClosed;
10171017
[self clearSessionTokenAndTTL];
10181018

1019-
int32_t code = (sessionCommand.hasCode ? sessionCommand.code : 0);
1020-
1021-
if (code == AVIMErrorCodeSessionConflict) {
1022-
[self->_pushManager removingClientIdFromChannels];
1023-
[self->_socketWrapper setActivatingReconnectionEnabled:false];
1024-
[self->_socketWrapper close];
1025-
id <AVIMClientDelegate> delegate = self->_delegate;
1026-
SEL sel = @selector(client:didOfflineWithError:);
1027-
if (delegate && [delegate respondsToSelector:sel]) {
1028-
[self invokeInUserInteractQueue:^{
1029-
NSError *aError = ({
1030-
LCIMProtobufCommandWrapper *commandWrapper = [LCIMProtobufCommandWrapper new];
1031-
commandWrapper.inCommand = inCommand;
1032-
commandWrapper.error;
1033-
});
1034-
[delegate client:self didOfflineWithError:aError];
1035-
}];
1036-
}
1019+
[self->_pushManager removingClientIdFromChannels];
1020+
[self->_socketWrapper setActivatingReconnectionEnabled:false];
1021+
[self->_socketWrapper close];
1022+
id <AVIMClientDelegate> delegate = self->_delegate;
1023+
SEL sel = @selector(client:didOfflineWithError:);
1024+
if (delegate && [delegate respondsToSelector:sel]) {
1025+
[self invokeInUserInteractQueue:^{
1026+
NSError *aError = ({
1027+
LCIMProtobufCommandWrapper *commandWrapper = [LCIMProtobufCommandWrapper new];
1028+
commandWrapper.inCommand = inCommand;
1029+
commandWrapper.error;
1030+
});
1031+
[delegate client:self didOfflineWithError:aError];
1032+
}];
10371033
}
10381034
}
10391035

0 commit comments

Comments
 (0)