New add some fuc

This commit is contained in:
hrxiang
2022-03-21 17:17:41 +08:00
parent 372e573ea0
commit 73b9eb776f
11 changed files with 136 additions and 22 deletions

View File

@@ -19,24 +19,40 @@ class MessageType {
static const custom_face = 115;
///
static const accept_friend = 201;
static const add_friend = 202;
static const refuse_friend_application = 203;
static const set_self_info = 204;
static const revoke_message = 205;
static const c2c_message_as_read = 206;
static const notificationBegin = 1000;
static const friendNotificationBegin = 1200;
static const kick_online = 303;
static const friendApplicationApprovedNotification = 1201;
static const friendApplicationRejectedNotification = 1202;
static const friendApplicationNotification = 1203;
static const friendAddedNotification = 1204;
static const friendDeletedNotification = 1205;
static const friendRemarkSetNotification = 1206;
static const blackAddedNotification = 1207;
static const blackDeletedNotification = 1208;
static const friendNotificationEnd = 1299;
static const conversationChangeNotification = 1300;
///
static const transfer_group_owner = 501;
static const create_group = 502;
// static const create_group = 503;
static const join_group = 504;
static const quit_group = 505;
static const set_group_info = 506;
static const accept_group_application = 507;
static const refuse_group_application = 508;
static const kick_group_member = 509;
static const invited_user_to_group = 510;
static const userNotificationBegin = 1301;
static const userInfoUpdatedNotification = 1303;
static const userNotificationEnd = 1399;
static const groupNotificationBegin = 1500;
static const groupCreatedNotification = 1501;
static const groupInfoSetNotification = 1502;
static const joinGroupApplicationNotification = 1503;
static const memberQuitNotification = 1504;
static const groupApplicationAcceptedNotification = 1505;
static const groupApplicationRejectedNotification = 1506;
static const groupOwnerTransferredNotification = 1507;
static const memberKickedNotification = 1508;
static const memberInvitedNotification = 1509;
static const memberEnterNotification = 1510;
static const groupNotificationEnd = 1599;
static const signalingNotificationBegin = 1600;
static const signalingNotification = 1601;
static const signalingNotificationEnd = 1699;
static const notificationEnd = 2000;
}

View File

@@ -162,6 +162,21 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// Mark group message as read
/// 标记群聊消息已读
Future markGroupMessageAsRead({
required String groupID,
required List<String> messageIDList,
String? operationID,
}) =>
_channel.invokeMethod(
'markGroupMessageAsRead',
_buildParam({
"messageIDList": messageIDList,
"groupID": groupID,
"operationID": Utils.checkOperationID(operationID),
}));
/// Typing
/// 正在输入提示
Future typingStatusUpdate({

View File

@@ -83,6 +83,18 @@ class SignalingManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 挂断
Future<dynamic> signalingHungUp({
required SignalingInfo info,
String? operationID,
}) =>
_channel.invokeMethod(
'signalingHungUp',
_buildParam({
'signalingInfo': info.toJson(),
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "signalingManager";
return param;

View File

@@ -37,6 +37,7 @@ class Message {
MergeElem? mergeElem;
NotificationElem? notificationElem;
FaceElem? faceElem;
AttachedInfoElem? attachedInfoElem;
Message({
this.clientMsgID,
@@ -71,6 +72,7 @@ class Message {
this.mergeElem,
this.notificationElem,
this.faceElem,
this.attachedInfoElem,
});
Message.fromJson(Map<String, dynamic> json) {
@@ -127,6 +129,9 @@ class Message {
: null;
faceElem =
json['faceElem'] != null ? FaceElem.fromJson(json['faceElem']) : null;
attachedInfoElem = json['attachedInfoElem'] != null
? AttachedInfoElem.fromJson(json['attachedInfoElem'])
: null;
}
Map<String, dynamic> toJson() {
@@ -163,6 +168,7 @@ class Message {
data['mergeElem'] = this.mergeElem?.toJson();
data['notificationElem'] = this.notificationElem?.toJson();
data['faceElem'] = this.faceElem?.toJson();
data['attachedInfoElem'] = this.attachedInfoElem?.toJson();
return data;
}
@@ -209,6 +215,7 @@ class Message {
mergeElem = message.mergeElem;
notificationElem = message.notificationElem;
faceElem = message.faceElem;
attachedInfoElem = message.attachedInfoElem;
}
}
@@ -572,6 +579,45 @@ class FaceElem {
}
}
class AttachedInfoElem {
GroupHasReadInfo? groupHasReadInfo;
AttachedInfoElem({this.groupHasReadInfo});
AttachedInfoElem.fromJson(Map<String, dynamic> json) {
groupHasReadInfo = json['groupHasReadInfo'] == null
? null
: GroupHasReadInfo.fromJson(json['groupHasReadInfo']);
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson();
return data;
}
}
class GroupHasReadInfo {
List<String>? hasReadUserIDList;
int? hasReadCount;
GroupHasReadInfo.fromJson(Map<String, dynamic> json) {
if (json['hasReadUserIDList'] == null) {
hasReadUserIDList = <String>[];
} else {
hasReadUserIDList = (json['hasReadUserIDList'] as List).cast<String>();
}
hasReadCount = json['hasReadCount'] ?? 0;
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['hasReadUserIDList'] = this.hasReadUserIDList;
data['hasReadCount'] = this.hasReadCount;
return data;
}
}
class ReadReceiptInfo {
String? userID;
String? groupID;