Skip to content

Commit

Permalink
Merge pull request #540 from easemob/dev_4.0.0+1
Browse files Browse the repository at this point in the history
fix: ios image or video message to dart message error.
  • Loading branch information
dujiepeng committed Mar 2, 2023
2 parents c451ec8 + 08af4f9 commit cf64a6b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## NEXT

## 4.0.0 Easemob IM Flutter 端发版说明
## 4.0.0+1

#### 修复

- 修复图片消息和视频消息转换失败的问题。

## 4.0.0

#### 新增特性

Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/EMChatManagerWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ - (void)fetchGroupReadAck:(NSDictionary *)param
break;
}
e = nil;
} while (false);
} while (NO);
if (e != nil) {
[weakSelf wrapperCallBack:result
channelName:aChannelName
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/EMChatMessage+Helper.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/EMGroup+Helper.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions lib/src/models/em_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
}
Expand Down Expand Up @@ -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"]);
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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"]);
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit cf64a6b

Please sign in to comment.