New some function
This commit is contained in:
@@ -50,6 +50,11 @@ class MessageType {
|
||||
static const dismissGroupNotification = 1511;
|
||||
static const groupNotificationEnd = 1599;
|
||||
|
||||
static const groupMemberMutedNotification = 1512;
|
||||
static const groupMemberCancelMutedNotification = 1513;
|
||||
static const groupMutedNotification = 1514;
|
||||
static const groupCancelMutedNotification = 1515;
|
||||
|
||||
static const signalingNotificationBegin = 1600;
|
||||
static const signalingNotification = 1601;
|
||||
static const signalingNotificationEnd = 1699;
|
||||
|
||||
@@ -204,6 +204,21 @@ class ConversationManager {
|
||||
}))
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
/// burn after reading
|
||||
/// 阅后即焚
|
||||
Future<dynamic> setOneConversationPrivateChat({
|
||||
required String conversationID,
|
||||
required bool isPrivate,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setOneConversationPrivateChat',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isPrivate": isPrivate,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Custom sort for conversation list
|
||||
/// 会话列表自定义排序规则。
|
||||
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||
|
||||
@@ -333,6 +333,38 @@ class GroupManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Enable group mute
|
||||
/// 开启群禁言
|
||||
Future<dynamic> changeGroupMute({
|
||||
required String groupID,
|
||||
required bool mute,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'changeGroupMute',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'mute': mute,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Mute group members
|
||||
/// 禁言群成员
|
||||
Future<dynamic> changeGroupMemberMute({
|
||||
required String groupID,
|
||||
required String userID,
|
||||
int seconds = 0,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'changeGroupMemberMute',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'uid': userID,
|
||||
'seconds': seconds,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
return param;
|
||||
|
||||
@@ -19,6 +19,7 @@ class ConversationInfo {
|
||||
String? draftText;
|
||||
int? draftTextTime;
|
||||
bool? isPinned;
|
||||
bool? isPrivateChat;
|
||||
String? ext;
|
||||
|
||||
ConversationInfo(
|
||||
@@ -34,6 +35,7 @@ class ConversationInfo {
|
||||
this.latestMsgSendTime,
|
||||
this.draftText,
|
||||
this.draftTextTime,
|
||||
this.isPrivateChat,
|
||||
this.isPinned});
|
||||
|
||||
ConversationInfo.fromJson(Map<String, dynamic> json)
|
||||
@@ -56,6 +58,7 @@ class ConversationInfo {
|
||||
draftText = json['draftText'];
|
||||
draftTextTime = json['draftTextTime'];
|
||||
isPinned = json['isPinned'];
|
||||
isPrivateChat = json['isPrivateChat'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -73,6 +76,7 @@ class ConversationInfo {
|
||||
data['draftText'] = this.draftText;
|
||||
data['draftTextTime'] = this.draftTextTime;
|
||||
data['isPinned'] = this.isPinned;
|
||||
data['isPrivateChat'] = this.isPrivateChat;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ class GroupInfo {
|
||||
String? ownerUserID;
|
||||
int? createTime;
|
||||
int? memberCount;
|
||||
/// ok = 0 blocked = 1 Dismissed = 2 Muted = 3
|
||||
int? status;
|
||||
String? creatorUserID;
|
||||
int? groupType;
|
||||
@@ -70,6 +71,7 @@ class GroupMembersInfo {
|
||||
int? joinSource;
|
||||
String? operatorUserID;
|
||||
String? ext;
|
||||
int? muteEndTime;
|
||||
|
||||
GroupMembersInfo({
|
||||
this.groupID,
|
||||
@@ -81,6 +83,7 @@ class GroupMembersInfo {
|
||||
this.ext,
|
||||
this.joinSource,
|
||||
this.operatorUserID,
|
||||
this.muteEndTime,
|
||||
});
|
||||
|
||||
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
|
||||
@@ -93,6 +96,7 @@ class GroupMembersInfo {
|
||||
ext = json['ext'];
|
||||
joinSource = json['joinSource'];
|
||||
operatorUserID = json['operatorUserID'];
|
||||
muteEndTime = json['muteEndTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -106,6 +110,7 @@ class GroupMembersInfo {
|
||||
data['ext'] = this.ext;
|
||||
data['joinSource'] = this.joinSource;
|
||||
data['operatorUserID'] = this.operatorUserID;
|
||||
data['muteEndTime'] = this.muteEndTime;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,18 +581,21 @@ class FaceElem {
|
||||
|
||||
class AttachedInfoElem {
|
||||
GroupHasReadInfo? groupHasReadInfo;
|
||||
bool? isPrivateChat;
|
||||
|
||||
AttachedInfoElem({this.groupHasReadInfo});
|
||||
AttachedInfoElem({this.groupHasReadInfo, this.isPrivateChat});
|
||||
|
||||
AttachedInfoElem.fromJson(Map<String, dynamic> json) {
|
||||
groupHasReadInfo = json['groupHasReadInfo'] == null
|
||||
? null
|
||||
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
|
||||
isPrivateChat = json['isPrivateChat'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson();
|
||||
data['isPrivateChat'] = this.isPrivateChat;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user