upgrade sdk
This commit is contained in:
@@ -7,7 +7,8 @@ class MessageType {
|
||||
static const file = 105;
|
||||
static const at_text = 106;
|
||||
static const merger = 107;
|
||||
static const forward = 108;
|
||||
// static const forward = 108;
|
||||
static const card = 108;
|
||||
static const location = 109;
|
||||
static const custom = 110;
|
||||
static const revoke = 111;
|
||||
|
||||
@@ -47,6 +47,12 @@ class FriendshipManager {
|
||||
.then((value) => _toList(value));
|
||||
}
|
||||
|
||||
Future<List<dynamic>> getFriendListMap() {
|
||||
return _channel
|
||||
.invokeMethod('getFriendList', _buildParam({}))
|
||||
.then((value) => _toListMap(value));
|
||||
}
|
||||
|
||||
/// modify friend information, only [comment] can be modified
|
||||
///
|
||||
Future<dynamic> setFriendInfo({required UserInfo info}) {
|
||||
@@ -131,6 +137,11 @@ class FriendshipManager {
|
||||
return (list as List).map((e) => UserInfo.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
static List<dynamic> _toListMap(String? value) {
|
||||
var list = _formatJson(value);
|
||||
return list;
|
||||
}
|
||||
|
||||
static UserInfo _toObj(String value) => UserInfo.fromJson(_formatJson(value));
|
||||
|
||||
static dynamic _formatJson(value) {
|
||||
|
||||
@@ -90,6 +90,24 @@ class GroupManager {
|
||||
.then((value) => GroupMembersList.fromJson(_formatJson(value)));
|
||||
}
|
||||
|
||||
// filter 0: all user, 1: group owner, 2: administrator
|
||||
/// begin index, pull and fill 0 for the first time
|
||||
Future<dynamic> getGroupMemberListMap({
|
||||
required String groupId,
|
||||
int filter = 0,
|
||||
int next = 0,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getGroupMemberList',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'filter': filter,
|
||||
'next': next,
|
||||
}))
|
||||
.then((value) => _formatJson(value));
|
||||
}
|
||||
|
||||
/// find all groups you have joined
|
||||
Future<List<GroupInfo>> getJoinedGroupList() {
|
||||
return _channel.invokeMethod('getJoinedGroupList', _buildParam({})).then(
|
||||
@@ -98,6 +116,13 @@ class GroupManager {
|
||||
.toList());
|
||||
}
|
||||
|
||||
/// find all groups you have joined
|
||||
Future<List<dynamic>> getJoinedGroupListMap() {
|
||||
return _channel
|
||||
.invokeMethod('getJoinedGroupList', _buildParam({}))
|
||||
.then((value) => _formatJson(value));
|
||||
}
|
||||
|
||||
/// check
|
||||
Future<bool> isJoinedGroup({required String gid}) {
|
||||
return getJoinedGroupList()
|
||||
|
||||
@@ -302,12 +302,12 @@ class MessageManager {
|
||||
}
|
||||
|
||||
///
|
||||
Future<Message> createForwardMessage({required List<Message> messageList}) {
|
||||
Future<Message> createForwardMessage({required Message message}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'createForwardMessage',
|
||||
_buildParam({
|
||||
'message': messageList.map((e) => e.toJson()).toList(),
|
||||
'message': message.toJson(),
|
||||
}))
|
||||
.then((value) => _toObj(value));
|
||||
}
|
||||
@@ -361,6 +361,18 @@ class MessageManager {
|
||||
.then((value) => _toObj(value));
|
||||
}
|
||||
|
||||
Future<Message> createCardMessage({
|
||||
required Map<String, dynamic> data,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'createCardMessage',
|
||||
_buildParam({
|
||||
'cardMessage': data,
|
||||
}))
|
||||
.then((value) => _toObj(value));
|
||||
}
|
||||
|
||||
///
|
||||
Future<dynamic> getTotalUnreadMsgCount() {
|
||||
return _channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({}));
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class ConversationInfo {
|
||||
String conversationID;
|
||||
/// [ConversationType]
|
||||
int? conversationType;
|
||||
String? userID;
|
||||
String? groupID;
|
||||
@@ -15,6 +16,8 @@ class ConversationInfo {
|
||||
int? latestMsgSendTime;
|
||||
String? draftText;
|
||||
int? draftTimestamp;
|
||||
|
||||
/// pinned value is 1
|
||||
dynamic isPinned;
|
||||
|
||||
ConversationInfo(
|
||||
@@ -78,4 +81,6 @@ class ConversationInfo {
|
||||
bool get isSingleChat => conversationType == ConversationType.single_chat;
|
||||
|
||||
bool get isGroupChat => conversationType == ConversationType.group_chat;
|
||||
|
||||
bool get isTop => isPinned == 1;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ class Message {
|
||||
String? sendID;
|
||||
String? recvID;
|
||||
int? msgFrom;
|
||||
|
||||
/// [MessageType]
|
||||
int? contentType;
|
||||
int? platformID;
|
||||
List<String>? forceList;
|
||||
@@ -17,9 +19,13 @@ class Message {
|
||||
String? content;
|
||||
int? seq;
|
||||
bool? isRead;
|
||||
|
||||
/// [MessageStatus]
|
||||
int? status;
|
||||
String? remark;
|
||||
dynamic ext;
|
||||
|
||||
/// [ConversationType]
|
||||
int? sessionType;
|
||||
PictureElem? pictureElem;
|
||||
SoundElem? soundElem;
|
||||
@@ -29,6 +35,7 @@ class Message {
|
||||
LocationElem? locationElem;
|
||||
CustomElem? customElem;
|
||||
QuoteElem? quoteElem;
|
||||
MergeElem? mergeElem;
|
||||
|
||||
Message({
|
||||
this.clientMsgID,
|
||||
@@ -59,6 +66,7 @@ class Message {
|
||||
this.locationElem,
|
||||
this.customElem,
|
||||
this.quoteElem,
|
||||
this.mergeElem,
|
||||
});
|
||||
|
||||
Message.fromJson(Map<String, dynamic> json)
|
||||
@@ -107,6 +115,9 @@ class Message {
|
||||
quoteElem = json['quoteElem'] != null
|
||||
? QuoteElem.fromJson(json['quoteElem'])
|
||||
: null;
|
||||
mergeElem = json['mergeElem'] != null
|
||||
? MergeElem.fromJson(json['mergeElem'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -139,6 +150,7 @@ class Message {
|
||||
data['locationElem'] = this.locationElem?.toJson();
|
||||
data['customElem'] = this.customElem?.toJson();
|
||||
data['quoteElem'] = this.quoteElem?.toJson();
|
||||
data['mergeElem'] = this.mergeElem?.toJson();
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -450,6 +462,34 @@ class QuoteElem {
|
||||
}
|
||||
}
|
||||
|
||||
class MergeElem {
|
||||
String? title;
|
||||
List<String>? abstractList;
|
||||
List<Message>? multiMessage;
|
||||
|
||||
MergeElem({this.title, this.abstractList, this.multiMessage});
|
||||
|
||||
MergeElem.fromJson(Map<String, dynamic> json) {
|
||||
title = json['title'];
|
||||
if (json['abstractList'] is List) {
|
||||
abstractList = json['abstractList'].cast<String>();
|
||||
}
|
||||
if (json['multiMessage'] is List) {
|
||||
multiMessage = (json['abstractList'] as List)
|
||||
.map((e) => Message.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['title'] = this.title;
|
||||
data['abstractList'] = this.abstractList;
|
||||
data['multiMessage'] = this.multiMessage?.map((e) => e.toJson()).toList();
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class HaveReadInfo {
|
||||
String? uid;
|
||||
List<String>? msgIDList;
|
||||
@@ -458,12 +498,13 @@ class HaveReadInfo {
|
||||
int? contentType;
|
||||
int? sessionType;
|
||||
|
||||
HaveReadInfo({this.uid,
|
||||
this.msgIDList,
|
||||
this.readTime,
|
||||
this.msgFrom,
|
||||
this.contentType,
|
||||
this.sessionType});
|
||||
HaveReadInfo(
|
||||
{this.uid,
|
||||
this.msgIDList,
|
||||
this.readTime,
|
||||
this.msgFrom,
|
||||
this.contentType,
|
||||
this.sessionType});
|
||||
|
||||
HaveReadInfo.fromJson(Map<String, dynamic> json) {
|
||||
uid = json['uid'];
|
||||
|
||||
@@ -77,9 +77,12 @@ class UserInfo {
|
||||
/// blacklist
|
||||
bool get isBlocked => isInBlackList == 1;
|
||||
|
||||
/// friend application
|
||||
/// friend application waiting handle
|
||||
bool get isWaitingHandle => flag == 0;
|
||||
|
||||
/// friend application agreed
|
||||
bool get isAgreed => flag == 1;
|
||||
|
||||
/// friend application
|
||||
/// friend application rejected
|
||||
bool get isRejected => flag == -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user