[Super Group]
This commit is contained in:
@@ -46,7 +46,7 @@ class ConversationManager {
|
||||
|
||||
/// 查询会话,如果会话不存在会自动生成一个
|
||||
/// [sourceID] 如果是单聊会话传userID,如果是群聊会话传GroupID
|
||||
/// [sessionType] 如果是单聊会话传1,如果是群聊会话传2
|
||||
/// [sessionType] 参考[ConversationType]
|
||||
Future<ConversationInfo> getOneConversation({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
@@ -149,7 +149,7 @@ class ConversationManager {
|
||||
|
||||
/// 查询会话id
|
||||
/// [sourceID] 如果是单聊值传用户ID,如果是群聊值传组ID
|
||||
/// [sessionType] 如果是单聊值传1,如果是群聊值传2
|
||||
/// [sessionType] 参考[ConversationType]
|
||||
Future<dynamic> getConversationIDBySessionType({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
|
||||
@@ -236,16 +236,19 @@ class GroupManager {
|
||||
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
/// 申请加入组,需要通过管理员/群组同意。
|
||||
/// [joinSource] 2:通过邀请 3:通过搜索 4:通过二维码
|
||||
Future<dynamic> joinGroup({
|
||||
required String gid,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
int joinSource = 3,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'reason': reason,
|
||||
'joinSource': joinSource,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -497,6 +500,54 @@ class GroupManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 不允许通过群获取成员资料
|
||||
/// [groupID] 群ID
|
||||
/// [status] 0:关闭,1:打开
|
||||
Future<dynamic> setGroupLookMemberInfo({
|
||||
required String groupID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupLookMemberInfo',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'status': status,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 不允许通过群添加好友
|
||||
/// [groupID] 群ID
|
||||
/// [status] 0:关闭,1:打开
|
||||
Future<dynamic> setGroupApplyMemberFriend({
|
||||
required String groupID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupApplyMemberFriend',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'status': status,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取群拥有者,管理员
|
||||
/// [groupId] 群ID
|
||||
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupMemberOwnerAndAdmin',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
return param;
|
||||
|
||||
@@ -147,6 +147,11 @@ class IMManager {
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvGroupMessageReadReceipt(list);
|
||||
break;
|
||||
case 'onNewRecvMessageRevoked':
|
||||
var value = call.arguments['data']['revokedMessageV2'];
|
||||
var info = Utils.toObj(value, (map) => RevokedInfo.fromJson(map));
|
||||
messageManager.msgListener.recvMessageRevokedV2(info);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.msgSendProgressListener) {
|
||||
String type = call.arguments['type'];
|
||||
|
||||
@@ -77,8 +77,9 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息
|
||||
/// 撤回消息[revokeMessageV2]
|
||||
/// [message] 被撤回的消息体
|
||||
@deprecated
|
||||
Future revokeMessage({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
@@ -686,6 +687,19 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息
|
||||
/// [message] 被撤回的消息体
|
||||
Future revokeMessageV2({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'newRevokeMessage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "messageManager";
|
||||
return param;
|
||||
|
||||
Reference in New Issue
Block a user