[Super Group]
This commit is contained in:
parent
cff0a4cce2
commit
18f099c437
@ -14,6 +14,9 @@
|
|||||||
- Add joinSource field for joinGroup method
|
- Add joinSource field for joinGroup method
|
||||||
- Add advanced revoke type
|
- Add advanced revoke type
|
||||||
- Add recvMessageRevokedV2 callback for OnAdvancedMsgListener
|
- Add recvMessageRevokedV2 callback for OnAdvancedMsgListener
|
||||||
|
- Add joinSource field for GroupApplicationInfo
|
||||||
|
- Add inviterUserID field for GroupApplicationInfo
|
||||||
|
- Add getAdvancedHistoryMessageList method for MessageManager
|
||||||
|
|
||||||
## 2.2.0
|
## 2.2.0
|
||||||
|
|
||||||
|
@ -41,5 +41,5 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.openim:core-sdk:2.3.0@aar'
|
implementation 'io.openim:core-sdk:2.3.0-rc1@aar'
|
||||||
}
|
}
|
@ -397,4 +397,13 @@ public class MessageManager extends BaseManager {
|
|||||||
jsonValue(methodCall)
|
jsonValue(methodCall)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getAdvancedHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.getAdvancedHistoryMessageList(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -700,6 +700,37 @@ class MessageManager {
|
|||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
})));
|
})));
|
||||||
|
|
||||||
|
/// 获取聊天记录(以startMsg为节点,以前的聊天记录)
|
||||||
|
/// [userID] 接收消息的用户id
|
||||||
|
/// [conversationID] 会话id,查询通知时可用
|
||||||
|
/// [groupID] 接收消息的组id
|
||||||
|
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.first
|
||||||
|
/// [count] 一次拉取的总数
|
||||||
|
/// [lastMinSeq] 第一页消息不用传,获取第二页开始必传 跟[startMsg]一样
|
||||||
|
Future<AdvancedMessage> getAdvancedHistoryMessageList({
|
||||||
|
String? userID,
|
||||||
|
String? groupID,
|
||||||
|
String? conversationID,
|
||||||
|
int? lastMinSeq,
|
||||||
|
Message? startMsg,
|
||||||
|
int? count,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'getAdvancedHistoryMessageList',
|
||||||
|
_buildParam({
|
||||||
|
'userID': userID ?? '',
|
||||||
|
'groupID': groupID ?? '',
|
||||||
|
'conversationID': conversationID ?? '',
|
||||||
|
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||||
|
'count': count ?? 40,
|
||||||
|
'lastMinSeq': lastMinSeq ?? 0,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) =>
|
||||||
|
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
return param;
|
return param;
|
||||||
|
@ -298,6 +298,12 @@ class GroupApplicationInfo {
|
|||||||
/// 扩展信息
|
/// 扩展信息
|
||||||
String? ex;
|
String? ex;
|
||||||
|
|
||||||
|
/// 2:通过邀请 3:通过搜索 4:通过二维码
|
||||||
|
int? joinSource;
|
||||||
|
|
||||||
|
/// 邀请进群用户ID
|
||||||
|
String? inviterUserID;
|
||||||
|
|
||||||
GroupApplicationInfo({
|
GroupApplicationInfo({
|
||||||
this.groupID,
|
this.groupID,
|
||||||
this.groupName,
|
this.groupName,
|
||||||
@ -321,6 +327,8 @@ class GroupApplicationInfo {
|
|||||||
this.handleUserID,
|
this.handleUserID,
|
||||||
this.handledTime,
|
this.handledTime,
|
||||||
this.ex,
|
this.ex,
|
||||||
|
this.inviterUserID,
|
||||||
|
this.joinSource,
|
||||||
});
|
});
|
||||||
|
|
||||||
GroupApplicationInfo.fromJson(Map<String, dynamic> json) {
|
GroupApplicationInfo.fromJson(Map<String, dynamic> json) {
|
||||||
@ -346,6 +354,8 @@ class GroupApplicationInfo {
|
|||||||
handleUserID = json['handleUserID'];
|
handleUserID = json['handleUserID'];
|
||||||
handledTime = json['handledTime'];
|
handledTime = json['handledTime'];
|
||||||
ex = json['ex'];
|
ex = json['ex'];
|
||||||
|
inviterUserID = json['inviterUserID'];
|
||||||
|
joinSource = json['joinSource'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -372,6 +382,8 @@ class GroupApplicationInfo {
|
|||||||
data['handleUserID'] = this.handleUserID;
|
data['handleUserID'] = this.handleUserID;
|
||||||
data['handledTime'] = this.handledTime;
|
data['handledTime'] = this.handledTime;
|
||||||
data['ex'] = this.ex;
|
data['ex'] = this.ex;
|
||||||
|
data['inviterUserID'] = this.inviterUserID;
|
||||||
|
data['joinSource'] = this.joinSource;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1034,3 +1034,41 @@ class RevokedInfo {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AdvancedMessage {
|
||||||
|
List<Message>? messageList;
|
||||||
|
bool? isEnd;
|
||||||
|
int? errCode;
|
||||||
|
String? errMsg;
|
||||||
|
int? lastMinSeq;
|
||||||
|
|
||||||
|
AdvancedMessage({
|
||||||
|
this.messageList,
|
||||||
|
this.isEnd,
|
||||||
|
this.errCode,
|
||||||
|
this.errMsg,
|
||||||
|
this.lastMinSeq,
|
||||||
|
});
|
||||||
|
|
||||||
|
AdvancedMessage.fromJson(Map<String, dynamic> json) {
|
||||||
|
messageList = json['messageList'] == null
|
||||||
|
? null
|
||||||
|
: (json['messageList'] as List)
|
||||||
|
.map((e) => Message.fromJson(e))
|
||||||
|
.toList();
|
||||||
|
isEnd = json['isEnd'];
|
||||||
|
errCode = json['errCode'];
|
||||||
|
errMsg = json['errMsg'];
|
||||||
|
lastMinSeq = json['lastMinSeq'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['messageList'] = this.messageList?.map((e) => e.toJson()).toList();
|
||||||
|
data['isEnd'] = this.isEnd;
|
||||||
|
data['errCode'] = this.errCode;
|
||||||
|
data['errMsg'] = this.errMsg;
|
||||||
|
data['lastMinSeq'] = this.lastMinSeq;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -2,14 +2,14 @@ import 'dart:convert';
|
|||||||
|
|
||||||
class Utils {
|
class Utils {
|
||||||
static List<T> toList<T>(String value, T f(Map<String, dynamic> map)) =>
|
static List<T> toList<T>(String value, T f(Map<String, dynamic> map)) =>
|
||||||
(_formatJson(value) as List).map((e) => f(e)).toList();
|
(formatJson(value) as List).map((e) => f(e)).toList();
|
||||||
|
|
||||||
static T toObj<T>(String value, T f(Map<String, dynamic> map)) =>
|
static T toObj<T>(String value, T f(Map<String, dynamic> map)) =>
|
||||||
f(_formatJson(value));
|
f(formatJson(value));
|
||||||
|
|
||||||
static List<dynamic> toListMap(String value) => _formatJson(value);
|
static List<dynamic> toListMap(String value) => formatJson(value);
|
||||||
|
|
||||||
static dynamic _formatJson(String value) => jsonDecode(value);
|
static dynamic formatJson(String value) => jsonDecode(value);
|
||||||
|
|
||||||
static String checkOperationID(String? obj) =>
|
static String checkOperationID(String? obj) =>
|
||||||
obj ?? DateTime.now().millisecondsSinceEpoch.toString();
|
obj ?? DateTime.now().millisecondsSinceEpoch.toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user