Upgrade
This commit is contained in:
@@ -8,6 +8,7 @@ class OnSignalingListener {
|
||||
final Function(SignalingInfo info)? onReceiveNewInvitation;
|
||||
final Function(SignalingInfo info)? onInviteeRejectedByOtherDevice;
|
||||
final Function(SignalingInfo info)? onInviteeAcceptedByOtherDevice;
|
||||
final Function(SignalingInfo info)? onHangup;
|
||||
|
||||
OnSignalingListener({
|
||||
this.onInvitationCancelled,
|
||||
@@ -17,6 +18,7 @@ class OnSignalingListener {
|
||||
this.onReceiveNewInvitation,
|
||||
this.onInviteeAcceptedByOtherDevice,
|
||||
this.onInviteeRejectedByOtherDevice,
|
||||
this.onHangup,
|
||||
});
|
||||
|
||||
/// 被邀请者收到:邀请者取消音视频通话
|
||||
@@ -53,4 +55,9 @@ class OnSignalingListener {
|
||||
void inviteeRejectedByOtherDevice(SignalingInfo info) {
|
||||
onInviteeRejectedByOtherDevice?.call(info);
|
||||
}
|
||||
|
||||
/// 被挂断
|
||||
void hangup(SignalingInfo info) {
|
||||
onHangup?.call(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +243,24 @@ class ConversationManager {
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Reset group converstaion at type
|
||||
/// 重置at标准位
|
||||
Future<dynamic> resetConversationGroupAtType({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'resetConversationGroupAtType',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Get @ all member tag
|
||||
/// 查询at所有人标识
|
||||
Future<dynamic> getAtAllTag() =>
|
||||
_channel.invokeMethod('getAtAllTag', _buildParam({}));
|
||||
|
||||
/// Custom sort for conversation list
|
||||
/// 会话列表自定义排序规则。
|
||||
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||
|
||||
@@ -382,6 +382,31 @@ class GroupManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Search group
|
||||
/// 查询群
|
||||
/// [keywordList] 搜索关键词,目前仅支持一个关键词搜索,不能为空
|
||||
/// [isSearchGroupID] 是否以关键词搜索群ID(注:两个不可以同时为false),为空默认false
|
||||
/// [isSearchGroupName] 是否以关键词搜索群名字,为空默认false
|
||||
Future<List<GroupInfo>> searchGroups({
|
||||
List<String> keywordList = const [],
|
||||
bool isSearchGroupID = false,
|
||||
bool isSearchGroupName = false,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'searchGroups',
|
||||
_buildParam({
|
||||
'searchParam': {
|
||||
'keywordList': keywordList,
|
||||
'isSearchGroupID': isSearchGroupID,
|
||||
'isSearchGroupName': isSearchGroupName,
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then(
|
||||
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
return param;
|
||||
|
||||
@@ -258,6 +258,9 @@ class IMManager {
|
||||
case 'onInviteeRejectedByOtherDevice':
|
||||
signalingManager.listener.inviteeRejectedByOtherDevice(u);
|
||||
break;
|
||||
case 'onHangUp':
|
||||
signalingManager.listener.hangup(u);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.workMomentsListener) {
|
||||
String type = call.arguments['type'];
|
||||
|
||||
@@ -529,8 +529,7 @@ class MessageManager {
|
||||
|
||||
/// Search local message
|
||||
/// 搜索消息
|
||||
/// [sourceID]单聊为用户ID,群聊为群ID
|
||||
/// [sessionType]会话类型,单聊为1,群聊为2,如果为0,则代表搜索全部
|
||||
/// [conversationID] 根据会话查询,如果是全局搜索传null
|
||||
/// [keywordList]搜索关键词列表,目前仅支持一个关键词搜索
|
||||
/// [keywordListMatchType]关键词匹配模式,1代表与,2代表或,暂时未用
|
||||
/// [senderUserIDList]指定消息发送的uid列表 暂时未用
|
||||
@@ -540,8 +539,7 @@ class MessageManager {
|
||||
/// [pageIndex]当前页数
|
||||
/// [count]每页数量
|
||||
Future<SearchResult> searchLocalMessages({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
String? conversationID,
|
||||
List<String> keywordList = const [],
|
||||
int keywordListMatchType = 0,
|
||||
List<String> senderUserIDList = const [],
|
||||
@@ -557,8 +555,7 @@ class MessageManager {
|
||||
'searchLocalMessages',
|
||||
_buildParam({
|
||||
'filter': {
|
||||
'sourceID': sourceID,
|
||||
'sessionType': sessionType,
|
||||
'conversationID': conversationID,
|
||||
'keywordList': keywordList,
|
||||
'keywordListMatchType': keywordListMatchType,
|
||||
'senderUserIDList': senderUserIDList,
|
||||
@@ -649,6 +646,32 @@ class MessageManager {
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Find all history message
|
||||
/// 获取聊天记录
|
||||
/// [userID]接收消息的用户id
|
||||
/// [conversationID] 会话id
|
||||
/// [groupID]接收消息的组id
|
||||
Future<List<Message>> getHistoryMessageListReverse({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getHistoryMessageListReverse',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 10,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "messageManager";
|
||||
return param;
|
||||
|
||||
@@ -32,7 +32,12 @@ class SearchResultItems {
|
||||
/// 会话ID
|
||||
String? conversationID;
|
||||
|
||||
/// 这个会话下的消息数量
|
||||
/// 会话类型1单聊,2群聊,3,超级大群,4通知会话
|
||||
int? conversationType;
|
||||
String? showName;
|
||||
String? faceURL;
|
||||
|
||||
/// 搜索到的这个会话下的消息数量
|
||||
int? messageCount;
|
||||
|
||||
/// [Message]的列表
|
||||
@@ -42,6 +47,9 @@ class SearchResultItems {
|
||||
|
||||
SearchResultItems.fromJson(Map<String, dynamic> json) {
|
||||
conversationID = json['conversationID'];
|
||||
conversationType = json['conversationType'];
|
||||
showName = json['showName'];
|
||||
faceURL = json['faceURL'];
|
||||
messageCount = json['messageCount'];
|
||||
if (json['messageList'] != null) {
|
||||
messageList = <Message>[];
|
||||
@@ -54,6 +62,9 @@ class SearchResultItems {
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['conversationID'] = this.conversationID;
|
||||
data['conversationType'] = this.conversationType;
|
||||
data['showName'] = this.showName;
|
||||
data['faceURL'] = this.faceURL;
|
||||
data['messageCount'] = this.messageCount;
|
||||
if (this.messageList != null) {
|
||||
data['messageList'] = this.messageList!.map((v) => v.toJson()).toList();
|
||||
|
||||
Reference in New Issue
Block a user