From b0ff43b43d1927af9fcf611dd374faaff010c615 Mon Sep 17 00:00:00 2001 From: zapcannon87 Date: Sun, 28 Oct 2018 18:31:48 +0800 Subject: [PATCH 1/3] Fix test case --- AVOS/AVOSCloudIMTests/Swift/AVIMConversationTestCase.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AVOS/AVOSCloudIMTests/Swift/AVIMConversationTestCase.swift b/AVOS/AVOSCloudIMTests/Swift/AVIMConversationTestCase.swift index 4fcd749a8..6f73ee91e 100644 --- a/AVOS/AVOSCloudIMTests/Swift/AVIMConversationTestCase.swift +++ b/AVOS/AVOSCloudIMTests/Swift/AVIMConversationTestCase.swift @@ -307,7 +307,7 @@ class AVIMConversationTestCase: LCIMTestBase { } }) } else { - semaphore.decrement() + semaphore.decrement(2) XCTFail() } }) From 724794671f4a5965cc149a27f69fc32cff146600 Mon Sep 17 00:00:00 2001 From: zapcannon87 Date: Sun, 28 Oct 2018 18:45:37 +0800 Subject: [PATCH 2/3] Fix conversation from keyed conversation has not last message. --- AVOS/AVOSCloudIM/Client/AVIMClient.m | 57 ++++++++++++++++------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/AVOS/AVOSCloudIM/Client/AVIMClient.m b/AVOS/AVOSCloudIM/Client/AVIMClient.m index fcff701b4..a79a8cf8f 100644 --- a/AVOS/AVOSCloudIM/Client/AVIMClient.m +++ b/AVOS/AVOSCloudIM/Client/AVIMClient.m @@ -1938,30 +1938,6 @@ - (AVIMConversation *)conversationWithKeyedConversation:(AVIMKeyedConversation * if (keyedConversation.updateAt) { rawDataDic[AVIMConversationKeyUpdatedAt] = keyedConversation.updateAt; } - if (keyedConversation.lastMessage) { - AVIMMessage *message = keyedConversation.lastMessage; - if (message.content) { - rawDataDic[AVIMConversationKeyLastMessageContent] = message.content; - } - if (message.messageId) { - rawDataDic[AVIMConversationKeyLastMessageId] = message.messageId; - } - if (message.clientId) { - rawDataDic[AVIMConversationKeyLastMessageFrom] = message.clientId; - } - if (message.sendTimestamp) { - rawDataDic[AVIMConversationKeyLastMessageTimestamp] = @(message.sendTimestamp); - } - if (message.updatedAt) { - rawDataDic[AVIMConversationKeyLastMessagePatchTimestamp] = @(message.updatedAt.timeIntervalSince1970 * 1000.0); - } - if (message.mentionAll) { - rawDataDic[AVIMConversationKeyLastMessageMentionAll] = @(message.mentionAll); - } - if (message.mentionList) { - rawDataDic[AVIMConversationKeyLastMessageMentionPids] = message.mentionList; - } - } if (keyedConversation.name) { rawDataDic[AVIMConversationKeyName] = keyedConversation.name; } @@ -1993,6 +1969,39 @@ - (AVIMConversation *)conversationWithKeyedConversation:(AVIMKeyedConversation * rawDataDic[AVIMConversationKeyMutedMembers] = @(keyedConversation.muted); } } + if (keyedConversation.lastMessage) { + AVIMMessage *message = keyedConversation.lastMessage; + [rawDataDic removeObjectsForKeys:({ + @[AVIMConversationKeyLastMessageContent, + AVIMConversationKeyLastMessageId, + AVIMConversationKeyLastMessageFrom, + AVIMConversationKeyLastMessageTimestamp, + AVIMConversationKeyLastMessagePatchTimestamp, + AVIMConversationKeyLastMessageMentionAll, + AVIMConversationKeyLastMessageMentionPids]; + })]; + if (message.content) { + rawDataDic[AVIMConversationKeyLastMessageContent] = message.content; + } + if (message.messageId) { + rawDataDic[AVIMConversationKeyLastMessageId] = message.messageId; + } + if (message.clientId) { + rawDataDic[AVIMConversationKeyLastMessageFrom] = message.clientId; + } + if (message.sendTimestamp) { + rawDataDic[AVIMConversationKeyLastMessageTimestamp] = @(message.sendTimestamp); + } + if (message.updatedAt) { + rawDataDic[AVIMConversationKeyLastMessagePatchTimestamp] = @(message.updatedAt.timeIntervalSince1970 * 1000.0); + } + if (message.mentionAll) { + rawDataDic[AVIMConversationKeyLastMessageMentionAll] = @(message.mentionAll); + } + if (message.mentionList) { + rawDataDic[AVIMConversationKeyLastMessageMentionPids] = message.mentionList; + } + } if (!conversationId) { return nil; } From c9f51e3d5b92e36a806bef7012851a74acadcdb7 Mon Sep 17 00:00:00 2001 From: zapcannon87 Date: Mon, 29 Oct 2018 15:31:49 +0800 Subject: [PATCH 3/3] Release v11.4.6 --- AVOS/AVOSCloud/UserAgent.h | 2 +- AVOSCloud.podspec | 2 +- AVOSCloudIM.podspec | 2 +- AVOSCloudLiveQuery.podspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AVOS/AVOSCloud/UserAgent.h b/AVOS/AVOSCloud/UserAgent.h index 5a4887e36..cf555e588 100644 --- a/AVOS/AVOSCloud/UserAgent.h +++ b/AVOS/AVOSCloud/UserAgent.h @@ -1 +1 @@ -#define SDK_VERSION @"v11.4.5" +#define SDK_VERSION @"v11.4.6" diff --git a/AVOSCloud.podspec b/AVOSCloud.podspec index 5798e380c..8173af352 100644 --- a/AVOSCloud.podspec +++ b/AVOSCloud.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'AVOSCloud' - s.version = '11.4.5' + s.version = '11.4.6' s.homepage = 'https://leancloud.cn/' s.summary = 'LeanCloud Objective-C SDK' s.authors = 'LeanCloud' diff --git a/AVOSCloudIM.podspec b/AVOSCloudIM.podspec index 3f7b2c743..8c0e29c8e 100644 --- a/AVOSCloudIM.podspec +++ b/AVOSCloudIM.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'AVOSCloudIM' - s.version = '11.4.5' + s.version = '11.4.6' s.homepage = 'https://leancloud.cn/' s.summary = 'LeanCloud IM Objective-C SDK' s.authors = 'LeanCloud' diff --git a/AVOSCloudLiveQuery.podspec b/AVOSCloudLiveQuery.podspec index a1ab051a9..eb6ef2379 100644 --- a/AVOSCloudLiveQuery.podspec +++ b/AVOSCloudLiveQuery.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'AVOSCloudLiveQuery' - s.version = '11.4.5' + s.version = '11.4.6' s.homepage = 'https://leancloud.cn/' s.summary = 'LeanCloud LiveQuery Objective-C SDK' s.authors = 'LeanCloud'