Add regularly delete
This commit is contained in:
parent
b06dbe122e
commit
b1fa710117
@ -53,5 +53,5 @@ dependencies {
|
||||
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
||||
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
||||
// api 'io.openim:core-sdk:2.3.5-t44@aar'
|
||||
implementation 'io.openim:core-sdk:3.0.0-enterprise-beta08@aar'
|
||||
implementation 'io.openim:core-sdk:3.0.0-enterprise-beta11@aar'
|
||||
}
|
@ -175,4 +175,22 @@ public class ConversationManager extends BaseManager {
|
||||
value(methodCall, "burnDuration")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationIsMsgDestruct(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationIsMsgDestruct(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isMsgDestruct")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationMsgDestructTime(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationMsgDestructTime(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
int2long(methodCall, "duration")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -304,6 +304,36 @@ class ConversationManager {
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 开启定期删除
|
||||
/// [isMsgDestruct] true 开启
|
||||
Future<dynamic> setConversationIsMsgDestruct({
|
||||
required String conversationID,
|
||||
bool isMsgDestruct = true,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationIsMsgDestruct',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isMsgDestruct": isMsgDestruct,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 定期删除聊天记录
|
||||
/// [duration] 秒
|
||||
Future<dynamic> setConversationMsgDestructTime({
|
||||
required String conversationID,
|
||||
int duration = 1 * 24 * 60 * 60,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationMsgDestructTime',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"duration": duration,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 会话列表自定义排序规则。
|
||||
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||
..sort((a, b) {
|
||||
|
@ -51,8 +51,11 @@ class ConversationInfo {
|
||||
/// 可阅读期限 s
|
||||
int? burnDuration;
|
||||
|
||||
/// 附加内容
|
||||
String? ext;
|
||||
/// 是否开启定期销毁
|
||||
bool? isMsgDestruct;
|
||||
|
||||
/// 定期销毁时间 s
|
||||
int? msgDestructTime;
|
||||
|
||||
/// 附加内容
|
||||
String? ex;
|
||||
@ -78,7 +81,9 @@ class ConversationInfo {
|
||||
this.isPinned,
|
||||
this.isNotInGroup,
|
||||
this.ex,
|
||||
this.ext,
|
||||
this.groupAtType,
|
||||
this.isMsgDestruct,
|
||||
this.msgDestructTime,
|
||||
});
|
||||
|
||||
ConversationInfo.fromJson(Map<String, dynamic> json)
|
||||
@ -106,7 +111,8 @@ class ConversationInfo {
|
||||
isNotInGroup = json['isNotInGroup'];
|
||||
groupAtType = json['groupAtType'];
|
||||
ex = json['ex'];
|
||||
ext = json['ext'];
|
||||
isMsgDestruct = json['isMsgDestruct'];
|
||||
msgDestructTime = json['msgDestructTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -129,7 +135,8 @@ class ConversationInfo {
|
||||
data['isNotInGroup'] = this.isNotInGroup;
|
||||
data['groupAtType'] = this.groupAtType;
|
||||
data['ex'] = this.ex;
|
||||
data['ext'] = this.ext;
|
||||
data['isMsgDestruct'] = this.isMsgDestruct;
|
||||
data['msgDestructTime'] = this.msgDestructTime;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user