New some function
This commit is contained in:
parent
e009224256
commit
197f0b482f
@ -2,7 +2,8 @@
|
||||
|
||||
1.New dismiss group </br>
|
||||
2.New search local message </br>
|
||||
3.Upgrade client-sdk to 2.0.18
|
||||
3.New private chat </br>
|
||||
4.New group mute
|
||||
|
||||
## 2.0.0+3
|
||||
|
||||
|
@ -41,5 +41,5 @@ android {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation 'io.openim:client-sdk:2.0.19@aar'
|
||||
implementation 'io.openim:client-sdk:2.0.22@aar'
|
||||
}
|
@ -118,4 +118,13 @@ public class ConversationManager extends BaseManager {
|
||||
jsonValue(methodCall, "conversationIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void setOneConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setOneConversationPrivateChat(
|
||||
new OnBaseListener(result),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isPrivate")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -154,6 +154,24 @@ public class GroupManager extends BaseManager {
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
);
|
||||
}
|
||||
|
||||
public void changeGroupMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeGroupMute(
|
||||
new OnBaseListener(result),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "mute")
|
||||
);
|
||||
}
|
||||
|
||||
public void changeGroupMemberMute(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeGroupMemberMute(
|
||||
new OnBaseListener(result),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
int2long(methodCall, "seconds")
|
||||
);
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ public class ConversationManager: BaseServiceManager {
|
||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
||||
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
||||
self["setOneConversationPrivateChat"] = setOneConversationPrivateChat
|
||||
}
|
||||
|
||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -78,6 +79,10 @@ public class ConversationManager: BaseServiceManager {
|
||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func setOneConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetOneConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,6 +22,8 @@ public class GroupManager: BaseServiceManager {
|
||||
self["acceptGroupApplication"] = acceptGroupApplication
|
||||
self["refuseGroupApplication"] = refuseGroupApplication
|
||||
self["dismissGroup"] = dismissGroup
|
||||
self["changeGroupMute"] = changeGroupMute
|
||||
self["changeGroupMemberMute"] = changeGroupMemberMute
|
||||
}
|
||||
|
||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -95,6 +97,14 @@ public class GroupManager: BaseServiceManager {
|
||||
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
}
|
||||
|
||||
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[bool: "mute"])
|
||||
}
|
||||
|
||||
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[int:"seconds"])
|
||||
}
|
||||
}
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
@ -27,6 +27,10 @@ FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullabl
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkChangeGroupMemberMute(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userID, long mutedSeconds);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkChangeGroupMute(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, BOOL isMute);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
||||
|
||||
// skipped function CheckResourceLoad with unsupported parameter or return types
|
||||
@ -244,4 +248,6 @@ FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase
|
||||
|
||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
|
||||
|
||||
FOUNDATION_EXPORT void Open_im_sdkWakeUp(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
|
||||
|
||||
#endif
|
||||
|
Binary file not shown.
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user