@@ -53,7 +53,7 @@ typedef JMReceiveChatRoomMessageListener = void Function(List<dynamic> messageLi
5353typedef JMReceiveApplyJoinGroupApprovalListener = void Function (JMReceiveApplyJoinGroupApprovalEvent event);
5454typedef JMReceiveGroupAdminRejectListener = void Function (JMReceiveGroupAdminRejectEvent event);
5555typedef JMReceiveGroupAdminApprovalListener = void Function (JMReceiveGroupAdminApprovalEvent event);
56- typedef JMMessageReceiptStatusChangeListener = void Function (JMConversationInfo conversation, List < String > serverMessageIdList);
56+ typedef JMMessageReceiptStatusChangeListener = void Function (JMConversationInfo conversation, List serverMessageIdList);
5757
5858class JMEventHandlers {
5959
@@ -815,6 +815,28 @@ class JmessageFlutter {
815815
816816 return JMNormalMessage .generateMessageFromJson (msgMap);
817817 }
818+ /**
819+ * 设置消息已读
820+ *
821+ * @param target 聊天对象, JMSingle | JMGroup
822+ * @param messageId 本地数据库中的消息id,非 serverMessageId
823+ *
824+ * */
825+ Future <dynamic > setHaveRead ({
826+ @required dynamic type, /// (JMSingle | JMGroup | JMChatRoom)
827+ @required String messageId,
828+ }) async {
829+ Map param = type.toJson ();
830+
831+ param..addAll ({
832+ 'messageId' : messageId,
833+ });
834+
835+ Map msgMap = await _channel.invokeMethod ('setHaveRead' ,
836+ param..removeWhere ((key,value) => value == null ));
837+
838+ return JMNormalMessage .generateMessageFromJson (msgMap);
839+ }
818840
819841 /**
820842 * 删除本地单条消息
@@ -2507,6 +2529,17 @@ class JMConversationInfo {
25072529 return msg;
25082530 }
25092531
2532+ Future <JMFileMessage > setHaveRead ({
2533+ @required dynamic type, /// (JMSingle | JMGroup | JMChatRoom)
2534+ @required String messageId,
2535+ }) async {
2536+ JMFileMessage msg = await JmessageFlutter ().setHaveRead (
2537+ type: target.targetType,
2538+ messageId: messageId
2539+ );
2540+ return msg;
2541+ }
2542+
25102543 // getHistoryMessages
25112544 Future <List > getHistoryMessages ({
25122545 @required int from,
0 commit comments