Skip to content

Commit

Permalink
Merge pull request #576 from zapcannon87/master
Browse files Browse the repository at this point in the history
release: 12.0.0
  • Loading branch information
zapcannon87 authored Oct 8, 2019
2 parents 42f451e + a594571 commit 26f06ba
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 89 deletions.
2 changes: 1 addition & 1 deletion AVOS/AVOSCloud/UserAgent.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define SDK_VERSION @"12.0.0-beta.1"
#define SDK_VERSION @"12.0.0"
30 changes: 14 additions & 16 deletions AVOS/AVOSCloudIM/Client/AVIMClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -445,30 +445,28 @@ - (void)resumeWithSessionToken:(NSString *)sessionToken callback:(void (^)(BOOL
outCommand.appId = [AVOSCloud getApplicationId];
outCommand.peerId = self->_clientId;
outCommand.sessionMessage = sessionCommand;
sessionCommand.deviceToken = self->_pushManager.deviceToken ?: AVUtils.deviceUUID;
sessionCommand.ua = USER_AGENT;
sessionCommand.r = true;
if (sessionToken) {
sessionCommand.st = sessionToken;
} else {
if (signature && signature.signature && signature.timestamp && signature.nonce) {
sessionCommand.s = signature.signature;
sessionCommand.t = signature.timestamp;
sessionCommand.n = signature.nonce;
}
if (self->_tag) {
sessionCommand.tag = self->_tag;
}
if (self->_sessionConfigBitmap) {
sessionCommand.configBitmap = self->_sessionConfigBitmap;
}
sessionCommand.deviceToken = self->_pushManager.deviceToken ?: AVUtils.deviceUUID;
sessionCommand.ua = USER_AGENT;
if (self->_tag) {
sessionCommand.tag = self->_tag;
}
if (self->_sessionConfigBitmap) {
sessionCommand.configBitmap = self->_sessionConfigBitmap;
}
if (self->_lastPatchTimestamp) {
sessionCommand.lastPatchTime = self->_lastPatchTimestamp;
}
if (self->_lastUnreadTimestamp) {
sessionCommand.lastUnreadNotifTime = self->_lastUnreadTimestamp;
}
if (sessionToken) {
sessionCommand.st = sessionToken;
} else if (signature && signature.signature && signature.timestamp && signature.nonce) {
sessionCommand.s = signature.signature;
sessionCommand.t = signature.timestamp;
sessionCommand.n = signature.nonce;
}
LCIMProtobufCommandWrapper *commandWrapper = [LCIMProtobufCommandWrapper new];
commandWrapper.outCommand = outCommand;
return commandWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ typedef void (^AVIMCommandResultBlock)(AVIMGenericCommand *outCommand, AVIMGener
@property (nonatomic, copy) AVIMCommandResultBlock callback;
@property (nonatomic, assign) BOOL needResponse;

/*!
序列化时必须要调用。为AVIMGenericCommand对象添加必要的三个字段:needResponse、SerialId、messageObject,,在command完全初始化之后调用
@param command 具体的Command对象
*
*/
- (void)avim_addRequiredKeyWithCommand:(LCIMMessage *)command;

/*!
序列化时必须要调用。为AVIMGenericCommand对象添加必要的三个字段:s、t、n
@param signature AVIMSignature签名对象
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,68 +36,6 @@ - (void)setNeedResponse:(BOOL)needResponse {
objc_setAssociatedObject(self, @selector(needResponse), needResponseObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (void)avim_addRequiredKeyWithCommand:(LCIMMessage *)command {
AVIMCommandType commandType = self.cmd;
switch (commandType) {

case AVIMCommandType_Session:
self.sessionMessage = (AVIMSessionCommand *)command;
break;

case AVIMCommandType_Conv:
self.convMessage = (AVIMConvCommand *)command;
break;

case AVIMCommandType_Direct:
self.directMessage = (AVIMDirectCommand *)command;
break;

case AVIMCommandType_Ack:
self.ackMessage = (AVIMAckCommand *)command;
self.needResponse = NO;
break;

case AVIMCommandType_Rcp:
self.rcpMessage = (AVIMRcpCommand *)command;
break;

case AVIMCommandType_Unread:
self.unreadMessage = (AVIMUnreadCommand *)command;
break;

case AVIMCommandType_Logs:
self.logsMessage = (AVIMLogsCommand *)command;
break;

case AVIMCommandType_Error:
self.errorMessage = (AVIMErrorCommand *)command;
break;

case AVIMCommandType_Data:
self.dataMessage = (AVIMDataCommand *)command;
break;

case AVIMCommandType_Room:
self.roomMessage = (AVIMRoomCommand *)command;
break;

case AVIMCommandType_Read:
self.readMessage = (AVIMReadCommand *)command;
break;

case AVIMCommandType_Presence :
self.presenceMessage = (AVIMPresenceCommand *)command;
break;

case AVIMCommandType_Report:
self.reportMessage = (AVIMReportCommand *)command;
break;

default:
break;
}
}

- (void)avim_addRequiredKeyForConvMessageWithSignature:(AVIMSignature *)signature {
NSAssert(self.hasConvMessage, ([NSString stringWithFormat:@"before call %@, make sure you have called `-avim_addRequiredKey`", NSStringFromSelector(_cmd)]));
if (signature) {
Expand Down
2 changes: 1 addition & 1 deletion AVOSCloud.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVOSCloud'
s.version = '12.0.0-beta.1'
s.version = '12.0.0'
s.homepage = 'https://leancloud.cn/'
s.summary = 'LeanCloud Objective-C SDK'
s.authors = 'LeanCloud'
Expand Down
2 changes: 1 addition & 1 deletion AVOSCloudIM.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVOSCloudIM'
s.version = '12.0.0-beta.1'
s.version = '12.0.0'
s.homepage = 'https://leancloud.cn/'
s.summary = 'LeanCloud IM Objective-C SDK'
s.authors = 'LeanCloud'
Expand Down
2 changes: 1 addition & 1 deletion AVOSCloudLiveQuery.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVOSCloudLiveQuery'
s.version = '12.0.0-beta.1'
s.version = '12.0.0'
s.homepage = 'https://leancloud.cn/'
s.summary = 'LeanCloud LiveQuery Objective-C SDK'
s.authors = 'LeanCloud'
Expand Down

0 comments on commit 26f06ba

Please sign in to comment.