[Super Group]
This commit is contained in:
parent
a9343bf892
commit
c76bfeb07a
4
.idea/libraries/Flutter_Plugins.xml
generated
4
.idea/libraries/Flutter_Plugins.xml
generated
@ -1,8 +1,6 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$" />
|
||||
</CLASSES>
|
||||
<CLASSES />
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
|
17
CHANGELOG.md
17
CHANGELOG.md
@ -1,3 +1,20 @@
|
||||
## 2.3.0
|
||||
|
||||
1.Fix bug </br>
|
||||
2.Add super group type </br>
|
||||
3.Add setGroupLookMemberInfo method </br>
|
||||
4.Add setGroupApplyMemberFriend method </br>
|
||||
5.Add lookMemberInfo field </br>
|
||||
6.Add applyMemberFriend field</br>
|
||||
7.Add inviterUserID field</br>
|
||||
8.Add notificationUpdateTime field</br>
|
||||
9.Add notificationUserID field</br>
|
||||
10.Add joinSource field for joinGroup method </br>
|
||||
11.Add advanced revoke type</br>
|
||||
12.Add recvMessageRevokedV2 callback</br>
|
||||
13.Add revokeMessageV2 method </br>
|
||||
14.Add getGroupOwnerAndAdmin method</br>
|
||||
|
||||
## 2.2.0
|
||||
|
||||
1.Fix bug </br>
|
||||
|
@ -41,5 +41,5 @@ android {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation 'io.openim:core-sdk:2.2.0@aar'
|
||||
implementation 'io.openim:core-sdk:2.3.0@aar'
|
||||
}
|
@ -13,6 +13,14 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
this.id = listenerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewRecvMessageRevoked(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessageV2", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onNewRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
|
@ -91,7 +91,8 @@ public class GroupManager extends BaseManager {
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "reason")
|
||||
value(methodCall, "reason"),
|
||||
value(methodCall, "joinSource")
|
||||
);
|
||||
}
|
||||
|
||||
@ -219,4 +220,27 @@ public class GroupManager extends BaseManager {
|
||||
value(methodCall, "needVerification")
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupLookMemberInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupLookMemberInfo(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "status")
|
||||
);
|
||||
}
|
||||
|
||||
public void setGroupApplyMemberFriend(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupApplyMemberFriend(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "status")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMemberOwnerAndAdmin(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMemberOwnerAndAdmin(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
}
|
@ -389,4 +389,12 @@ public class MessageManager extends BaseManager {
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void newRevokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.newRevokeMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -41,5 +41,7 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -68,7 +68,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.2.0"
|
||||
version: "2.3.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
@ -29,6 +29,9 @@ public class GroupManager: BaseServiceManager {
|
||||
self["setGroupMemberRoleLevel"] = setGroupMemberRoleLevel
|
||||
self["getGroupMemberListByJoinTimeFilter"] = getGroupMemberListByJoinTimeFilter
|
||||
self["setGroupVerification"] = setGroupVerification
|
||||
self["setGroupLookMemberInfo"] = setGroupLookMemberInfo
|
||||
self["setGroupApplyMemberFriend"] = setGroupApplyMemberFriend
|
||||
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
|
||||
}
|
||||
|
||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -72,7 +75,7 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"])
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
|
||||
}
|
||||
|
||||
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -130,6 +133,18 @@ public class GroupManager: BaseServiceManager {
|
||||
func setGroupVerification(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupVerification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"needVerification"])
|
||||
}
|
||||
|
||||
func setGroupLookMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupLookMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
|
||||
}
|
||||
|
||||
func setGroupApplyMemberFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupApplyMemberFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
|
||||
}
|
||||
|
||||
func getGroupMemberOwnerAndAdmin(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMemberOwnerAndAdmin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
@ -44,6 +44,7 @@ public class MessageManager: BaseServiceManager {
|
||||
self["clearC2CHistoryMessageFromLocalAndSvr"] = clearC2CHistoryMessageFromLocalAndSvr
|
||||
self["clearGroupHistoryMessageFromLocalAndSvr"] = clearGroupHistoryMessageFromLocalAndSvr
|
||||
self["getHistoryMessageListReverse"] = getHistoryMessageListReverse
|
||||
self["newRevokeMessage"] = newRevokeMessage
|
||||
}
|
||||
|
||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@ -214,6 +215,12 @@ public class MessageManager: BaseServiceManager {
|
||||
Open_im_sdkGetHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func newRevokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkNewRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
||||
private let channel: FlutterMethodChannel
|
||||
private let result: FlutterResult
|
||||
@ -279,5 +286,11 @@ public class MessageManager: BaseServiceManager {
|
||||
values["newMessage"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onNewRecvMessageRevoked(_ messageRevoked: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["revokedMessageV2"] = messageRevoked
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onNewRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ A new Flutter project.
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '8.0'
|
||||
|
||||
s.dependency 'OpenIMSDKCore','2.2.0'
|
||||
s.dependency 'OpenIMSDKCore','2.3.0'
|
||||
s.static_framework = true
|
||||
# s.vendored_frameworks = 'Framework/*.framework'
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
|
@ -3,9 +3,12 @@ class ConversationType {
|
||||
/// 单聊
|
||||
static const single = 1;
|
||||
|
||||
/// 群聊
|
||||
/// 群
|
||||
static const group = 2;
|
||||
|
||||
/// 大群
|
||||
static const superGroup = 3;
|
||||
|
||||
/// 通知
|
||||
static const notification = 4;
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ class MessageType {
|
||||
/// 自定义表情
|
||||
static const custom_face = 115;
|
||||
|
||||
/// 高级撤回
|
||||
static const advancedRevoke = 118;
|
||||
|
||||
/// 通知类型
|
||||
static const notificationBegin = 1000;
|
||||
|
||||
|
@ -6,6 +6,7 @@ class OnAdvancedMsgListener {
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(RevokedInfo info)? onRecvMessageRevokedV2;
|
||||
|
||||
/// Uniquely identifies
|
||||
String id;
|
||||
@ -13,8 +14,9 @@ class OnAdvancedMsgListener {
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CMessageReadReceipt,
|
||||
this.onRecvGroupMessageReadReceipt,
|
||||
this.onRecvMessageRevoked,
|
||||
@deprecated this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvMessageRevokedV2,
|
||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
|
||||
/// C2C消息已读回执
|
||||
@ -36,4 +38,9 @@ class OnAdvancedMsgListener {
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void recvMessageRevokedV2(RevokedInfo info) {
|
||||
onRecvMessageRevokedV2?.call(info);
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class ConversationManager {
|
||||
|
||||
/// 查询会话,如果会话不存在会自动生成一个
|
||||
/// [sourceID] 如果是单聊会话传userID,如果是群聊会话传GroupID
|
||||
/// [sessionType] 如果是单聊会话传1,如果是群聊会话传2
|
||||
/// [sessionType] 参考[ConversationType]
|
||||
Future<ConversationInfo> getOneConversation({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
@ -149,7 +149,7 @@ class ConversationManager {
|
||||
|
||||
/// 查询会话id
|
||||
/// [sourceID] 如果是单聊值传用户ID,如果是群聊值传组ID
|
||||
/// [sessionType] 如果是单聊值传1,如果是群聊值传2
|
||||
/// [sessionType] 参考[ConversationType]
|
||||
Future<dynamic> getConversationIDBySessionType({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
|
@ -236,16 +236,19 @@ class GroupManager {
|
||||
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
/// 申请加入组,需要通过管理员/群组同意。
|
||||
/// [joinSource] 2:通过邀请 3:通过搜索 4:通过二维码
|
||||
Future<dynamic> joinGroup({
|
||||
required String gid,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
int joinSource = 3,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'reason': reason,
|
||||
'joinSource': joinSource,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@ -497,6 +500,54 @@ class GroupManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 不允许通过群获取成员资料
|
||||
/// [groupID] 群ID
|
||||
/// [status] 0:关闭,1:打开
|
||||
Future<dynamic> setGroupLookMemberInfo({
|
||||
required String groupID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupLookMemberInfo',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'status': status,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 不允许通过群添加好友
|
||||
/// [groupID] 群ID
|
||||
/// [status] 0:关闭,1:打开
|
||||
Future<dynamic> setGroupApplyMemberFriend({
|
||||
required String groupID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupApplyMemberFriend',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'status': status,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取群拥有者,管理员
|
||||
/// [groupId] 群ID
|
||||
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupMemberOwnerAndAdmin',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
return param;
|
||||
|
@ -147,6 +147,11 @@ class IMManager {
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvGroupMessageReadReceipt(list);
|
||||
break;
|
||||
case 'onNewRecvMessageRevoked':
|
||||
var value = call.arguments['data']['revokedMessageV2'];
|
||||
var info = Utils.toObj(value, (map) => RevokedInfo.fromJson(map));
|
||||
messageManager.msgListener.recvMessageRevokedV2(info);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.msgSendProgressListener) {
|
||||
String type = call.arguments['type'];
|
||||
|
@ -77,8 +77,9 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息
|
||||
/// 撤回消息[revokeMessageV2]
|
||||
/// [message] 被撤回的消息体
|
||||
@deprecated
|
||||
Future revokeMessage({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
@ -686,6 +687,19 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息
|
||||
/// [message] 被撤回的消息体
|
||||
Future revokeMessageV2({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'newRevokeMessage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "messageManager";
|
||||
return param;
|
||||
|
@ -118,9 +118,16 @@ class ConversationInfo {
|
||||
return data;
|
||||
}
|
||||
|
||||
/// 是单聊
|
||||
bool get isSingleChat => conversationType == ConversationType.single;
|
||||
|
||||
bool get isGroupChat => conversationType == ConversationType.group;
|
||||
/// 是群聊
|
||||
bool get isGroupChat =>
|
||||
conversationType == ConversationType.group ||
|
||||
conversationType == ConversationType.superGroup;
|
||||
|
||||
/// 是有效的
|
||||
bool get isValid => isSingleChat || isGroupChat && !isNotInGroup!;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
|
@ -32,7 +32,7 @@ class GroupInfo {
|
||||
/// 创建者ID
|
||||
String? creatorUserID;
|
||||
|
||||
/// 群类型
|
||||
/// 群类型[GroupType]
|
||||
int? groupType;
|
||||
|
||||
/// 扩展字段
|
||||
@ -41,6 +41,18 @@ class GroupInfo {
|
||||
/// 进群验证方式[GroupVerification]
|
||||
int? needVerification;
|
||||
|
||||
/// 不允许通过群获取成员资料 0:关闭,1:打开
|
||||
int? lookMemberInfo;
|
||||
|
||||
/// 不允许通过群添加好友 0:关闭,1:打开
|
||||
int? applyMemberFriend;
|
||||
|
||||
/// 通知更新时间
|
||||
int? notificationUpdateTime;
|
||||
|
||||
/// 通知发起人
|
||||
String? notificationUserID;
|
||||
|
||||
GroupInfo({
|
||||
required this.groupID,
|
||||
this.groupName,
|
||||
@ -55,6 +67,10 @@ class GroupInfo {
|
||||
this.groupType,
|
||||
this.ex,
|
||||
this.needVerification,
|
||||
this.lookMemberInfo,
|
||||
this.applyMemberFriend,
|
||||
this.notificationUpdateTime,
|
||||
this.notificationUserID,
|
||||
});
|
||||
|
||||
GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] {
|
||||
@ -71,6 +87,10 @@ class GroupInfo {
|
||||
groupType = json['groupType'];
|
||||
ex = json['ex'];
|
||||
needVerification = json['needVerification'];
|
||||
lookMemberInfo = json['lookMemberInfo'];
|
||||
applyMemberFriend = json['applyMemberFriend'];
|
||||
notificationUpdateTime = json['notificationUpdateTime'];
|
||||
notificationUserID = json['notificationUserID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -88,8 +108,17 @@ class GroupInfo {
|
||||
data['groupType'] = this.groupType;
|
||||
data['ex'] = this.ex;
|
||||
data['needVerification'] = this.needVerification;
|
||||
data['lookMemberInfo'] = this.lookMemberInfo;
|
||||
data['applyMemberFriend'] = this.applyMemberFriend;
|
||||
data['notificationUpdateTime'] = this.notificationUpdateTime;
|
||||
data['notificationUserID'] = this.notificationUserID;
|
||||
return data;
|
||||
}
|
||||
|
||||
/// 群类型对应的会话类型
|
||||
int get sessionType => groupType == GroupType.general
|
||||
? ConversationType.group
|
||||
: ConversationType.superGroup;
|
||||
}
|
||||
|
||||
/// 群成员信息
|
||||
@ -112,7 +141,7 @@ class GroupMembersInfo {
|
||||
/// 加入时间
|
||||
int? joinTime;
|
||||
|
||||
/// 入群方式
|
||||
/// 入群方式 2:邀请加入 3:搜索加入 4:通过二维码加入
|
||||
int? joinSource;
|
||||
|
||||
/// 操作者id
|
||||
@ -123,8 +152,13 @@ class GroupMembersInfo {
|
||||
|
||||
/// 禁言时间s
|
||||
int? muteEndTime;
|
||||
|
||||
///
|
||||
int? appMangerLevel;
|
||||
|
||||
/// 邀请人id
|
||||
String? inviterUserID;
|
||||
|
||||
GroupMembersInfo({
|
||||
this.groupID,
|
||||
this.userID,
|
||||
@ -137,6 +171,7 @@ class GroupMembersInfo {
|
||||
this.operatorUserID,
|
||||
this.muteEndTime,
|
||||
this.appMangerLevel,
|
||||
this.inviterUserID,
|
||||
});
|
||||
|
||||
GroupMembersInfo.fromJson(Map<String, dynamic> json) {
|
||||
@ -151,6 +186,7 @@ class GroupMembersInfo {
|
||||
operatorUserID = json['operatorUserID'];
|
||||
muteEndTime = json['muteEndTime'];
|
||||
appMangerLevel = json['appMangerLevel'];
|
||||
inviterUserID = json['inviterUserID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -166,6 +202,7 @@ class GroupMembersInfo {
|
||||
data['operatorUserID'] = this.operatorUserID;
|
||||
data['muteEndTime'] = this.muteEndTime;
|
||||
data['appMangerLevel'] = this.appMangerLevel;
|
||||
data['inviterUserID'] = this.inviterUserID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -287,6 +287,14 @@ class Message {
|
||||
faceElem = message.faceElem;
|
||||
attachedInfoElem = message.attachedInfoElem;
|
||||
}
|
||||
|
||||
/// 单聊消息
|
||||
bool get isSingleChat => sessionType == ConversationType.single;
|
||||
|
||||
/// 群聊消息
|
||||
bool get isGroupChat =>
|
||||
sessionType == ConversationType.group ||
|
||||
sessionType == ConversationType.superGroup;
|
||||
}
|
||||
|
||||
/// 图片消息内容
|
||||
@ -958,3 +966,71 @@ class AtUserInfo {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 消息撤回具体信息
|
||||
class RevokedInfo {
|
||||
/// 撤回者ID
|
||||
String? revokerID;
|
||||
|
||||
/// 撤回者群角色 [GroupRoleLevel]
|
||||
int? revokerRole;
|
||||
|
||||
/// 撤回者昵称
|
||||
String? revokerNickname;
|
||||
|
||||
/// 消息id
|
||||
String? clientMsgID;
|
||||
|
||||
/// 撤回时间
|
||||
int? revokeTime;
|
||||
|
||||
/// 消息发送时间
|
||||
int? sourceMessageSendTime;
|
||||
|
||||
/// 消息发送者
|
||||
String? sourceMessageSendID;
|
||||
|
||||
/// 消息发送者昵称
|
||||
String? sourceMessageSenderNickname;
|
||||
|
||||
/// 会话类型 [ConversationType]
|
||||
int? sessionType;
|
||||
|
||||
RevokedInfo({
|
||||
this.revokerID,
|
||||
this.revokerRole,
|
||||
this.revokerNickname,
|
||||
this.clientMsgID,
|
||||
this.revokeTime,
|
||||
this.sourceMessageSendTime,
|
||||
this.sourceMessageSendID,
|
||||
this.sourceMessageSenderNickname,
|
||||
this.sessionType,
|
||||
});
|
||||
|
||||
RevokedInfo.fromJson(Map<String, dynamic> json) {
|
||||
revokerID = json['revokerID'];
|
||||
revokerRole = json['revokerRole'];
|
||||
revokerNickname = json['revokerNickname'];
|
||||
clientMsgID = json['clientMsgID'];
|
||||
revokeTime = json['revokeTime'];
|
||||
sourceMessageSendTime = json['sourceMessageSendTime'];
|
||||
sourceMessageSendID = json['sourceMessageSendID'];
|
||||
sourceMessageSenderNickname = json['sourceMessageSenderNickname'];
|
||||
sessionType = json['sessionType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['revokerID'] = this.revokerID;
|
||||
data['revokerRole'] = this.revokerRole;
|
||||
data['revokerNickname'] = this.revokerNickname;
|
||||
data['clientMsgID'] = this.clientMsgID;
|
||||
data['revokeTime'] = this.revokeTime;
|
||||
data['sourceMessageSendTime'] = this.sourceMessageSendTime;
|
||||
data['sourceMessageSendID'] = this.sourceMessageSendID;
|
||||
data['sourceMessageSenderNickname'] = this.sourceMessageSenderNickname;
|
||||
data['sessionType'] = this.sessionType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
@ -322,6 +322,13 @@ class FriendInfo {
|
||||
data['ex'] = this.ex;
|
||||
return data;
|
||||
}
|
||||
|
||||
String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!;
|
||||
|
||||
static String? _isNull(String? value) {
|
||||
if (value == null || value.trim().isEmpty) return null;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
/// 黑名单信息
|
||||
|
@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OpenIM {
|
||||
static const version = '2.1.0';
|
||||
static const version = '2.3.0';
|
||||
|
||||
static const _channel = const MethodChannel('flutter_openim_sdk');
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: flutter_openim_sdk
|
||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||
version: 2.2.0
|
||||
version: 2.3.0
|
||||
homepage: https://www.rentsoft.cn
|
||||
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user