From cd06c3bb5a20ece506f9cdf82802e09d62c226b6 Mon Sep 17 00:00:00 2001 From: xianghr Date: Fri, 9 Sep 2022 17:17:31 +0800 Subject: [PATCH] 3.2.2 --- .idea/libraries/Dart_SDK.xml | 39 +++++++++-------- CHANGELOG.md | 20 ++++++++- .../manager/MessageManager.java | 21 ++++++++++ example/pubspec.lock | 42 +++++++++---------- lib/src/enum/message_type.dart | 6 +++ lib/src/manager/im_message_manager.dart | 40 ++++++++++++++++++ lib/src/models/group_info.dart | 2 +- lib/src/models/message.dart | 34 +++++++++++++++ pubspec.lock | 36 ++++++++-------- pubspec.yaml | 2 +- 10 files changed, 180 insertions(+), 62 deletions(-) diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index a54d004..91dae00 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,26 +1,25 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 988608d..456696d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.3.2 + +- Fix bug +- Add createAdvancedQuoteMessage method for MessageManager +- Add createAdvancedTextMessage method for MessageManager + ## 2.3.0+1 - Fix bug @@ -189,33 +195,42 @@ Fix bug 2. Add createFileMessageFromFullPath method ## 0.0.9+4 + Fix ios friendship params error ## 0.0.9+3 + Ios native remove method 'removeAdvancedMsgListener' ## 0.0.9+2 + 1. Fix bug 2. Upgrade sdk ## 0.0.9+1 + Fix bug ## 0.0.9 + Add ios support ## 0.0.8 + Upgrade sdk to 0.0.14
Sending a message adds a retry mechanism ## 0.0.7 + 1. Add a new method to obtain conversation id based on user id or group id
2. Modify the type of conversation manager input parameter sessionType to int ## 0.0.6 + Fix bug ## 0.0.5 + Upgrade sdk
Fix message error bug @@ -224,11 +239,14 @@ Fix message error bug Replace the input parameters of the createCustomMessage method from Uint8List to Map ## 0.0.3 + Upgrade sdk
Fix bug
## 0.0.2 -1. Move the markSingleMessageHasRead, markGroupMessageHasRead and getTotalUnreadMsgCount methods from the MessageManager class to the ConversationManager class.
+ +1. Move the markSingleMessageHasRead, markGroupMessageHasRead and getTotalUnreadMsgCount methods + from the MessageManager class to the ConversationManager class.
2. Modify the parameters of the setFriendInfo method.
3. Modify the parameters of the createGroup and setGroupInfo methods. diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java index e020b3c..1911d4a 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java @@ -11,6 +11,7 @@ import open_im_sdk.Open_im_sdk; public class MessageManager extends BaseManager { private final static String KEY_ID = "id"; + // private final static Map listeners = new HashMap<>(); /* private static boolean initializedListener = false; private final static Map listeners = new ConcurrentHashMap<>(); @@ -201,6 +202,7 @@ public class MessageManager extends BaseManager { value(methodCall, "operationID"), value(methodCall, "imagePath"))); } + public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createSoundMessage( @@ -413,4 +415,23 @@ public class MessageManager extends BaseManager { jsonValue(methodCall, "options") ); } + + public void createAdvancedTextMessage(MethodCall methodCall, MethodChannel.Result result) { + CommonUtil.runMainThreadReturn(result, + Open_im_sdk.createAdvancedTextMessage( + value(methodCall, "operationID"), + value(methodCall, "text"), + jsonValue(methodCall, "richMessageInfoList") + )); + } + + public void createAdvancedQuoteMessage(MethodCall methodCall, MethodChannel.Result result) { + CommonUtil.runMainThreadReturn(result, + Open_im_sdk.createAdvancedQuoteMessage( + value(methodCall, "operationID"), + value(methodCall, "quoteText"), + jsonValue(methodCall, "quoteMessage"), + jsonValue(methodCall, "richMessageInfoList") + )); + } } diff --git a/example/pubspec.lock b/example/pubspec.lock index a46490f..d6e0738 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,56 +5,56 @@ packages: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.16.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted - version: "1.0.3" + version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.3.0" flutter: @@ -68,7 +68,7 @@ packages: path: ".." relative: true source: path - version: "2.3.0" + version: "2.3.2" flutter_test: dependency: "direct dev" description: flutter @@ -78,28 +78,28 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "0.1.4" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.7.0" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.8.1" sky_engine: @@ -111,49 +111,49 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "0.4.9" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.1.2" sdks: diff --git a/lib/src/enum/message_type.dart b/lib/src/enum/message_type.dart index 21caf6a..985ad46 100644 --- a/lib/src/enum/message_type.dart +++ b/lib/src/enum/message_type.dart @@ -45,6 +45,12 @@ class MessageType { /// 自定义表情 static const custom_face = 115; + /// 群消息已读回执 + static const groupHasReadReceipt = 116; + + /// 富文本消息 + static const advancedText = 117; + /// 高级撤回 static const advancedRevoke = 118; diff --git a/lib/src/manager/im_message_manager.dart b/lib/src/manager/im_message_manager.dart index 7cf765e..29cd01f 100644 --- a/lib/src/manager/im_message_manager.dart +++ b/lib/src/manager/im_message_manager.dart @@ -752,6 +752,46 @@ class MessageManager { .then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(value))); + /// 富文本消息 + /// [text] 输入内容 + /// [list] 富文本消息具体详细 + Future createAdvancedTextMessage({ + required String text, + List list = const [], + String? operationID, + }) => + _channel + .invokeMethod( + 'createAdvancedTextMessage', + _buildParam({ + 'text': text, + 'richMessageInfoList': list.map((e) => e.toJson()).toList(), + "operationID": Utils.checkOperationID(operationID), + }), + ) + .then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); + + /// 富文本消息 + /// [text] 回复的内容 + /// [quoteMsg] 被回复的消息 + /// [list] 富文本消息具体详细 + Future createAdvancedQuoteMessage({ + required String text, + required Message quoteMsg, + List list = const [], + String? operationID, + }) => + _channel + .invokeMethod( + 'createAdvancedQuoteMessage', + _buildParam({ + 'quoteText': text, + 'quoteMessage': quoteMsg.toJson(), + 'richMessageInfoList': list.map((e) => e.toJson()).toList(), + "operationID": Utils.checkOperationID(operationID), + })) + .then((value) => Utils.toObj(value, (map) => Message.fromJson(map))); + static Map _buildParam(Map param) { param["ManagerName"] = "messageManager"; return param; diff --git a/lib/src/models/group_info.dart b/lib/src/models/group_info.dart index 7011157..43dc21f 100644 --- a/lib/src/models/group_info.dart +++ b/lib/src/models/group_info.dart @@ -219,7 +219,7 @@ class GroupMembersInfo { @override bool operator ==(Object other) => identical(this, other) || - other is GroupMembersInfo && + other is GroupMembersInfo && runtimeType == other.runtimeType && groupID == other.groupID && userID == other.userID; diff --git a/lib/src/models/message.dart b/lib/src/models/message.dart index 4316694..5ee11f3 100644 --- a/lib/src/models/message.dart +++ b/lib/src/models/message.dart @@ -1072,3 +1072,37 @@ class AdvancedMessage { return data; } } + +class RichMessageInfo { + String? type; + int? offset; + int? length; + String? url; + String? info; + + RichMessageInfo({ + this.type, + this.offset, + this.length, + this.url, + this.info, + }); + + RichMessageInfo.fromJson(Map json) { + type = json['type']; + offset = json['offset']; + length = json['length']; + url = json['url']; + info = json['info']; + } + + Map toJson() { + final data = Map(); + data['type'] = this.type; + data['offset'] = this.offset; + data['length'] = this.length; + data['url'] = this.url; + data['info'] = this.info; + return data; + } +} diff --git a/pubspec.lock b/pubspec.lock index 72b79cf..4f45481 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,49 +5,49 @@ packages: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.16.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.3.0" flutter: @@ -64,28 +64,28 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "0.1.4" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.7.0" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.8.1" sky_engine: @@ -97,49 +97,49 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "0.4.9" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://mirrors.sjtug.sjtu.edu.cn/dart-pub/" source: hosted version: "2.1.2" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 406cf63..2ce57dc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_openim_sdk description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source. -version: 2.3.0 +version: 2.3.2 homepage: https://www.rentsoft.cn repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter