|
|
|
@ -33,8 +33,7 @@ class GroupManager { |
|
|
|
|
'reason': reason, |
|
|
|
|
"operationID": Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupInviteResult.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Remove group members |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -55,8 +54,7 @@ class GroupManager { |
|
|
|
|
'reason': reason, |
|
|
|
|
"operationID": Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupInviteResult.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Query group member information |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -74,8 +72,7 @@ class GroupManager { |
|
|
|
|
'userIDList': userIDList, |
|
|
|
|
"operationID": Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Paginate and retrieve the group member list |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -99,8 +96,7 @@ class GroupManager { |
|
|
|
|
'count': count, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Paginate and retrieve the group member list as a map |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -181,36 +177,17 @@ class GroupManager { |
|
|
|
|
'ownerUserID': ownerUserID, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then( |
|
|
|
|
(value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Edit group information |
|
|
|
|
Future<dynamic> setGroupInfo({ |
|
|
|
|
required String groupID, |
|
|
|
|
String? groupName, |
|
|
|
|
String? notification, |
|
|
|
|
String? introduction, |
|
|
|
|
String? faceURL, |
|
|
|
|
String? ex, |
|
|
|
|
int? needVerification, |
|
|
|
|
int? lookMemberInfo, |
|
|
|
|
int? applyMemberFriend, |
|
|
|
|
Future<dynamic> setGroupInfo( |
|
|
|
|
GroupInfo groupInfo, { |
|
|
|
|
String? operationID, |
|
|
|
|
}) => |
|
|
|
|
_channel.invokeMethod( |
|
|
|
|
'setGroupInfo', |
|
|
|
|
_buildParam({ |
|
|
|
|
'groupInfo': { |
|
|
|
|
"groupID": groupID, |
|
|
|
|
"groupName": groupName, |
|
|
|
|
"notification": notification, |
|
|
|
|
"introduction": introduction, |
|
|
|
|
"faceURL": faceURL, |
|
|
|
|
"ex": ex, |
|
|
|
|
'needVerification': needVerification, |
|
|
|
|
'lookMemberInfo': lookMemberInfo, |
|
|
|
|
'applyMemberFriend': applyMemberFriend, |
|
|
|
|
}, |
|
|
|
|
'groupInfo': groupInfo.toJson(), |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
@ -226,8 +203,7 @@ class GroupManager { |
|
|
|
|
'groupIDList': groupIDList, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then( |
|
|
|
|
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Apply to join a group, requiring approval from an administrator or the group. |
|
|
|
|
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code |
|
|
|
@ -275,28 +251,22 @@ class GroupManager { |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
/// Handle group membership applications received as a group owner or administrator |
|
|
|
|
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient( |
|
|
|
|
{String? operationID}) => |
|
|
|
|
_channel |
|
|
|
|
.invokeMethod( |
|
|
|
|
'getGroupApplicationListAsRecipient', |
|
|
|
|
_buildParam({ |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); |
|
|
|
|
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({String? operationID}) => _channel |
|
|
|
|
.invokeMethod( |
|
|
|
|
'getGroupApplicationListAsRecipient', |
|
|
|
|
_buildParam({ |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Get the list of group membership applications sent by the user |
|
|
|
|
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant( |
|
|
|
|
{String? operationID}) => |
|
|
|
|
_channel |
|
|
|
|
.invokeMethod( |
|
|
|
|
'getGroupApplicationListAsApplicant', |
|
|
|
|
_buildParam({ |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); |
|
|
|
|
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({String? operationID}) => _channel |
|
|
|
|
.invokeMethod( |
|
|
|
|
'getGroupApplicationListAsApplicant', |
|
|
|
|
_buildParam({ |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Accept a group membership application as an administrator or group owner |
|
|
|
|
/// Note: Membership applications require approval from administrators or the group. |
|
|
|
@ -422,8 +392,7 @@ class GroupManager { |
|
|
|
|
}, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then( |
|
|
|
|
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Set group member role |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -451,7 +420,7 @@ class GroupManager { |
|
|
|
|
int count = 0, |
|
|
|
|
int joinTimeBegin = 0, |
|
|
|
|
int joinTimeEnd = 0, |
|
|
|
|
List<String> excludeUserIDList = const [], |
|
|
|
|
List<String> filterUserIDList = const [], |
|
|
|
|
String? operationID, |
|
|
|
|
}) => |
|
|
|
|
_channel |
|
|
|
@ -463,11 +432,10 @@ class GroupManager { |
|
|
|
|
'count': count, |
|
|
|
|
'joinTimeBegin': joinTimeBegin, |
|
|
|
|
'joinTimeEnd': joinTimeEnd, |
|
|
|
|
'excludeUserIDList': excludeUserIDList, |
|
|
|
|
'excludeUserIDList': filterUserIDList, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Set group verification for joining |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -530,8 +498,7 @@ class GroupManager { |
|
|
|
|
'groupID': groupID, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Search for group members |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -563,8 +530,7 @@ class GroupManager { |
|
|
|
|
}, |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})) |
|
|
|
|
.then((value) => |
|
|
|
|
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map))); |
|
|
|
|
|
|
|
|
|
/// Query a group |
|
|
|
|
/// [groupID] Group ID |
|
|
|
@ -602,17 +568,13 @@ class GroupManager { |
|
|
|
|
Future<dynamic> setGroupMemberInfo({ |
|
|
|
|
required String groupID, |
|
|
|
|
required String userID, |
|
|
|
|
String? ex, |
|
|
|
|
required GroupMembersInfo groupMembersInfo, |
|
|
|
|
String? operationID, |
|
|
|
|
}) => |
|
|
|
|
_channel.invokeMethod( |
|
|
|
|
'setGroupMemberInfo', |
|
|
|
|
_buildParam({ |
|
|
|
|
'info': { |
|
|
|
|
'groupID': groupID, |
|
|
|
|
'userID': userID, |
|
|
|
|
'ex': ex, |
|
|
|
|
}, |
|
|
|
|
'info': groupMembersInfo.toJson(), |
|
|
|
|
'operationID': Utils.checkOperationID(operationID), |
|
|
|
|
})); |
|
|
|
|
static Map _buildParam(Map param) { |
|
|
|
|