diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e09fc99..96a86aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ ## NEXT -## 4.0.0 Easemob IM Flutter 端发版说明 +## 4.0.0+1 + +#### 修复 + +- 修复图片消息和视频消息转换失败的问题。 + +## 4.0.0 #### 新增特性 diff --git a/ios/Classes/EMChatManagerWrapper.m b/ios/Classes/EMChatManagerWrapper.m index eb57c359..7cba5e78 100644 --- a/ios/Classes/EMChatManagerWrapper.m +++ b/ios/Classes/EMChatManagerWrapper.m @@ -637,7 +637,7 @@ - (void)fetchGroupReadAck:(NSDictionary *)param break; } e = nil; - } while (false); + } while (NO); if (e != nil) { [weakSelf wrapperCallBack:result channelName:aChannelName diff --git a/ios/Classes/EMChatMessage+Helper.m b/ios/Classes/EMChatMessage+Helper.m index ce093339..5cef7b35 100644 --- a/ios/Classes/EMChatMessage+Helper.m +++ b/ios/Classes/EMChatMessage+Helper.m @@ -507,7 +507,7 @@ - (NSDictionary *)toJson { ret[@"secret"] = self.secretKey; ret[@"displayName"] = self.displayName; ret[@"localPath"] = self.localPath; - ret[@"sendOriginalImage"] = self.compressionRatio == 1.0 ? @(true) : @(false); + ret[@"sendOriginalImage"] = self.compressionRatio == 1.0 ? @(YES) : @(NO); return ret; } @end diff --git a/ios/Classes/EMGroup+Helper.m b/ios/Classes/EMGroup+Helper.m index 6b539057..2f7477d3 100644 --- a/ios/Classes/EMGroup+Helper.m +++ b/ios/Classes/EMGroup+Helper.m @@ -44,7 +44,7 @@ - (BOOL)isMemberOnly { if (self.settings.style == EMGroupStylePrivateOnlyOwnerInvite || self.settings.style == EMGroupStylePrivateMemberCanInvite || self.settings.style == EMGroupStylePublicJoinNeedApproval) { - return true; + return YES; } return NO; diff --git a/lib/src/models/em_message.dart b/lib/src/models/em_message.dart index 9ee0fca1..7a67de8c 100644 --- a/lib/src/models/em_message.dart +++ b/lib/src/models/em_message.dart @@ -710,8 +710,8 @@ class EMLocationMessageBody extends EMMessageBody { /// @nodoc EMLocationMessageBody.fromJson({required Map map}) : super.fromJson(map: map, type: MessageType.LOCATION) { - this.latitude = map["latitude"] ?? 0.0; - this.longitude = map["longitude"] ?? 0.0; + this.latitude = (map["latitude"] ?? 0).toDouble(); + this.longitude = (map["longitude"] ?? 0).toDouble(); this._address = map["address"]; this._buildingName = map["buildingName"]; } @@ -865,8 +865,8 @@ class EMImageMessageBody extends EMFileMessageBody { this.thumbnailRemotePath = map["thumbnailRemotePath"]; this.thumbnailSecret = map["thumbnailSecret"]; this.sendOriginalImage = map["sendOriginalImage"] ?? false; - this.height = map["height"]; - this.width = map["width"]; + this.height = (map["height"] ?? 0).toDouble(); + this.width = (map["width"] ?? 0).toDouble(); this.thumbnailStatus = EMFileMessageBody.downloadStatusFromInt(map["thumbnailStatus"]); } @@ -879,8 +879,8 @@ class EMImageMessageBody extends EMFileMessageBody { data.add("thumbnailRemotePath", thumbnailRemotePath); data.add("thumbnailSecret", thumbnailSecret); data.add("sendOriginalImage", sendOriginalImage); - data.add("height", height); - data.add("width", width); + data.add("height", height ?? 0.0); + data.add("width", width ?? 0.0); data.add("thumbnailStatus", downloadStatusToInt(this.thumbnailStatus)); return data; } @@ -1008,8 +1008,8 @@ class EMVideoMessageBody extends EMFileMessageBody { this.thumbnailLocalPath = map["thumbnailLocalPath"]; this.thumbnailRemotePath = map["thumbnailRemotePath"]; this.thumbnailSecret = map["thumbnailSecret"]; - this.height = map["height"]; - this.width = map["width"]; + this.height = (map["height"] ?? 0).toDouble(); + this.width = (map["width"] ?? 0).toDouble(); this.thumbnailStatus = EMFileMessageBody.downloadStatusFromInt(map["thumbnailStatus"]); } @@ -1022,8 +1022,8 @@ class EMVideoMessageBody extends EMFileMessageBody { data.add("thumbnailLocalPath", thumbnailLocalPath); data.add("thumbnailRemotePath", thumbnailRemotePath); data.add("thumbnailSecret", thumbnailSecret); - data.add("height", height); - data.add("width", width); + data.add("height", height ?? 0.0); + data.add("width", width ?? 0.0); data.add("thumbnailStatus", downloadStatusToInt(this.thumbnailStatus)); return data; diff --git a/pubspec.yaml b/pubspec.yaml index cba89bc1..559a95fe 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: im_flutter_sdk description: Integrate the Chat SDK to enjoy the global IM services with high reliability, ultra-low latency, and high concurrency. -version: 4.0.0 +version: 4.0.0+1 homepage: https://www.easemob.com/product/im environment: