diff --git a/OpenIMSDK.podspec b/OpenIMSDK.podspec index 19c6f84..63a97a8 100644 --- a/OpenIMSDK.podspec +++ b/OpenIMSDK.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'OpenIMSDK' - s.version = '2.3.0' + s.version = '2.3.1' s.summary = 'Open-IM-SDK' # This description is used to generate tags and improve search results. diff --git a/OpenIMSDK/Interface/OIMManager+Group.h b/OpenIMSDK/Interface/OIMManager+Group.h index cee99b4..eef5cc8 100644 --- a/OpenIMSDK/Interface/OIMManager+Group.h +++ b/OpenIMSDK/Interface/OIMManager+Group.h @@ -288,6 +288,13 @@ NS_ASSUME_NONNULL_BEGIN rule:(int32_t)rule onSuccess:(nullable OIMSuccessCallback)onSuccess onFailure:(nullable OIMFailureCallback)onFailure; + +/** + 搜索群成员 + */ +- (void)searchGroupMembers:(OIMSearchGroupMembersParam *)searchParam + onSuccess:(nullable OIMGroupMembersInfoCallback)onSuccess + onFailure:(nullable OIMFailureCallback)onFailure; @end NS_ASSUME_NONNULL_END diff --git a/OpenIMSDK/Interface/OIMManager+Group.m b/OpenIMSDK/Interface/OIMManager+Group.m index 360fc71..30e60f9 100644 --- a/OpenIMSDK/Interface/OIMManager+Group.m +++ b/OpenIMSDK/Interface/OIMManager+Group.m @@ -309,4 +309,16 @@ - (void)setGroupLookMemberInfo:(NSString *)groupID Open_im_sdkSetGroupLookMemberInfo(callback, [self operationId], groupID, rule); } + +- (void)searchGroupMembers:(OIMSearchParam *)searchParam + onSuccess:(OIMGroupMembersInfoCallback)onSuccess + onFailure:(OIMFailureCallback)onFailure { + CallbackProxy *callback = [[CallbackProxy alloc]initWithOnSuccess:^(NSString * _Nullable data) { + if (onSuccess) { + onSuccess([OIMGroupMemberInfo mj_objectArrayWithKeyValuesArray:data]); + } + } onFailure:onFailure]; + + Open_im_sdkSearchGroupMembers(callback, [self operationId], searchParam.mj_JSONString); +} @end diff --git a/OpenIMSDK/Interface/OIMManager+Message.h b/OpenIMSDK/Interface/OIMManager+Message.h index 3bbe268..7424ab9 100644 --- a/OpenIMSDK/Interface/OIMManager+Message.h +++ b/OpenIMSDK/Interface/OIMManager+Message.h @@ -235,11 +235,20 @@ NS_ASSUME_NONNULL_BEGIN /* - * 创建动图消息 + * 创建高级消息 * */ + (OIMMessageInfo *)createAdvancedTextMessage:(NSString *)text messageEntityList:(NSArray *)messageEntityList; + +/* + * 创建高级引用消息 + * + */ ++ (OIMMessageInfo *)createAdvancedQuoteMessage:(NSString *)text + message:(OIMMessageInfo *)message + messageEntityList:(NSArray *)messageEntityList; + @end @interface OIMManager (Message) @@ -504,6 +513,14 @@ NS_ASSUME_NONNULL_BEGIN - (void)getAdvancedHistoryMessageList:(OIMGetAdvancedHistoryMessageListParam *)opts onSuccess:(nullable OIMGetAdvancedHistoryMessageListCallback)onSuccess onFailure:(nullable OIMFailureCallback)onFailure; + +/** + 查找消息列表 + */ +- (void)findMessageList:(OIMFindMessageListParam *)param + onSuccess:(nullable OIMMessageSearchCallback)onSuccess + onFailure:(nullable OIMFailureCallback)onFailure; + @end NS_ASSUME_NONNULL_END diff --git a/OpenIMSDK/Interface/OIMManager+Message.m b/OpenIMSDK/Interface/OIMManager+Message.m index 2b6c870..80c16d9 100644 --- a/OpenIMSDK/Interface/OIMManager+Message.m +++ b/OpenIMSDK/Interface/OIMManager+Message.m @@ -216,6 +216,15 @@ + (OIMMessageInfo *)createAdvancedTextMessage:(NSString *)text return [self convertToMessageInfo:json]; } ++ (OIMMessageInfo *)createAdvancedQuoteMessage:(NSString *)text + message:(OIMMessageInfo *)message + messageEntityList:(NSArray *)messageEntityList { + NSArray *msgs = [OIMMessageEntity mj_keyValuesArrayWithObjectArray:messageEntityList]; + NSString *json = Open_im_sdkCreateAdvancedQuoteMessage([OIMManager.manager operationId], text, message.mj_JSONString, [[NSString alloc]initWithData:[NSJSONSerialization dataWithJSONObject:msgs options:0 error:nil] encoding:NSUTF8StringEncoding]); + + return [self convertToMessageInfo:json]; +} + @end @implementation OIMManager (Message) @@ -486,4 +495,16 @@ - (void)getAdvancedHistoryMessageList:(OIMGetAdvancedHistoryMessageListParam *)o Open_im_sdkGetAdvancedHistoryMessageList(callback, [self operationId], opts.mj_JSONString); } +- (void)findMessageList:(OIMFindMessageListParam *)param + onSuccess:(OIMMessageSearchCallback)onSuccess + onFailure:(OIMFailureCallback)onFailure { + CallbackProxy *callback = [[CallbackProxy alloc]initWithOnSuccess:^(NSString * _Nullable data) { + if (onSuccess) { + onSuccess([OIMSearchResultInfo mj_objectWithKeyValues:data]); + } + } onFailure:onFailure]; + + Open_im_sdkFindMessageList(callback, [self operationId], param.mj_JSONString); +} + @end diff --git a/OpenIMSDK/Model/OIMAttachedInfoElem.h b/OpenIMSDK/Model/OIMAttachedInfoElem.h index e092c2e..d9afca9 100644 --- a/OpenIMSDK/Model/OIMAttachedInfoElem.h +++ b/OpenIMSDK/Model/OIMAttachedInfoElem.h @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) BOOL notSenderNotificationPush; -@property (nonatomic, strong) NSArray *messageEntityList; +@property (nonatomic, copy) NSArray *messageEntityList; @end NS_ASSUME_NONNULL_END diff --git a/OpenIMSDK/Model/OIMMergeElem.h b/OpenIMSDK/Model/OIMMergeElem.h index 8088c7e..ee48c72 100644 --- a/OpenIMSDK/Model/OIMMergeElem.h +++ b/OpenIMSDK/Model/OIMMergeElem.h @@ -6,6 +6,7 @@ // #import +#import "OIMMessageElem.h" @class OIMMessageInfo; NS_ASSUME_NONNULL_BEGIN @@ -15,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, nullable, copy) NSString *title; @property (nonatomic, nullable, copy) NSArray *abstractList; @property (nonatomic, nullable, copy) NSArray *multiMessage; +@property (nonatomic, nullable, copy) NSArray *messageEntityList; @end diff --git a/OpenIMSDK/Model/OIMMergeElem.m b/OpenIMSDK/Model/OIMMergeElem.m index 27be53e..b721e19 100644 --- a/OpenIMSDK/Model/OIMMergeElem.m +++ b/OpenIMSDK/Model/OIMMergeElem.m @@ -13,7 +13,8 @@ @implementation OIMMergeElem + (NSDictionary *)mj_objectClassInArray { - return @{@"multiMessage" : [OIMMessageInfo class]}; + return @{@"multiMessage" : [OIMMessageInfo class], + @"messageEntityList" : [OIMMessageEntity class]}; } @end diff --git a/OpenIMSDK/Model/OIMMessageElem.h b/OpenIMSDK/Model/OIMMessageElem.h index aacf496..8129eec 100644 --- a/OpenIMSDK/Model/OIMMessageElem.h +++ b/OpenIMSDK/Model/OIMMessageElem.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @interface OIMMessageEntityElem : NSObject @property (nonatomic, copy) NSString *text; -@property (nonatomic, strong) NSArray *messageEntityList; +@property (nonatomic, copy) NSArray *messageEntityList; @end diff --git a/OpenIMSDK/Model/OIMQuoteElem.h b/OpenIMSDK/Model/OIMQuoteElem.h index b25a29e..36ed467 100644 --- a/OpenIMSDK/Model/OIMQuoteElem.h +++ b/OpenIMSDK/Model/OIMQuoteElem.h @@ -6,7 +6,7 @@ // #import - +#import "OIMMessageElem.h" @class OIMMessageInfo; NS_ASSUME_NONNULL_BEGIN @@ -17,6 +17,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, nullable, strong) OIMMessageInfo *quoteMessage; +@property (nonatomic, nullable, copy) NSArray *messageEntityList; @end NS_ASSUME_NONNULL_END diff --git a/OpenIMSDK/Model/OIMQuoteElem.m b/OpenIMSDK/Model/OIMQuoteElem.m index bf2d1aa..5670424 100644 --- a/OpenIMSDK/Model/OIMQuoteElem.m +++ b/OpenIMSDK/Model/OIMQuoteElem.m @@ -9,4 +9,9 @@ @implementation OIMQuoteElem ++ (NSDictionary *)mj_objectClassInArray +{ + return @{@"messageEntityList" : [OIMMessageEntity class]}; +} + @end diff --git a/OpenIMSDK/Model/OIMSearchParam.h b/OpenIMSDK/Model/OIMSearchParam.h index 45c79a9..25de837 100644 --- a/OpenIMSDK/Model/OIMSearchParam.h +++ b/OpenIMSDK/Model/OIMSearchParam.h @@ -111,6 +111,15 @@ NS_ASSUME_NONNULL_BEGIN @end + +@interface OIMFindMessageListParam : NSObject + +@property (nonatomic, copy) NSString *conversationID; + +@property (nonatomic, copy) NSArray *clientMsgIDList; + +@end + // 查询组织架构使用 @interface OIMSearchOrganizationParam : NSObject @@ -139,4 +148,22 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) BOOL isSearchTelephone; @end +// 查询群成员使用 +@interface OIMSearchGroupMembersParam : NSObject + +@property (nonatomic, copy) NSString *groupID; + +@property (nonatomic, copy) NSArray *keywordList; + +// 是否以关键词搜索UserID +@property (nonatomic, assign) BOOL isSearchUserID; + +// 是否以关键词搜索昵称,默认false +@property (nonatomic, assign) BOOL isSearchMemberNickname; + +@property (nonatomic, assign) NSInteger offset; + +@property (nonatomic, assign) NSInteger count; +@end + NS_ASSUME_NONNULL_END diff --git a/OpenIMSDK/Model/OIMSearchParam.m b/OpenIMSDK/Model/OIMSearchParam.m index f8519a1..f1be8f3 100644 --- a/OpenIMSDK/Model/OIMSearchParam.m +++ b/OpenIMSDK/Model/OIMSearchParam.m @@ -41,6 +41,14 @@ @implementation OIMSearchUserParam @end +@implementation OIMFindMessageListParam + +@end + +@implementation OIMSearchGroupMembersParam + +@end + @implementation OIMSearchOrganizationParam @end diff --git a/OpenIMSDK/Model/OIMSearchResultInfo.h b/OpenIMSDK/Model/OIMSearchResultInfo.h index a29e055..9c8c3c6 100644 --- a/OpenIMSDK/Model/OIMSearchResultInfo.h +++ b/OpenIMSDK/Model/OIMSearchResultInfo.h @@ -6,6 +6,7 @@ // #import +#import "OIMModelDefine.h" @class OIMMessageInfo; @@ -23,6 +24,12 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, assign) NSInteger messageCount; +@property (nonatomic, assign) OIMConversationType conversationType; + +@property (nonatomic, copy) NSString *showName; + +@property (nonatomic, copy) NSString *faceURL; + /* * OIMMessageInfo的列表 */ @@ -42,6 +49,9 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy) NSArray *searchResultItems; +// 仅适用于findMessageList函数的回调结果 +@property (nonatomic, copy) NSArray *findResultItems; + @end @interface OIMGetAdvancedHistoryMessageListInfo : NSObject diff --git a/OpenIMSDK/Model/OIMSearchResultInfo.m b/OpenIMSDK/Model/OIMSearchResultInfo.m index 5a24c75..7426539 100644 --- a/OpenIMSDK/Model/OIMSearchResultInfo.m +++ b/OpenIMSDK/Model/OIMSearchResultInfo.m @@ -22,11 +22,18 @@ @implementation OIMSearchResultInfo + (NSDictionary *)mj_objectClassInArray { - return @{@"searchResultItems" : [OIMSearchResultItemInfo class]}; + return @{@"searchResultItems" : [OIMSearchResultItemInfo class], + @"findResultItems" : [OIMSearchResultItemInfo class] + }; } @end @implementation OIMGetAdvancedHistoryMessageListInfo ++ (NSDictionary *)mj_objectClassInArray +{ + return @{@"messageList" : [OIMMessageInfo class]}; +} + @end diff --git a/OpenIMSDK/Utils/OIMModelDefine.h b/OpenIMSDK/Utils/OIMModelDefine.h index e8dae69..1ebee28 100644 --- a/OpenIMSDK/Utils/OIMModelDefine.h +++ b/OpenIMSDK/Utils/OIMModelDefine.h @@ -31,6 +31,8 @@ typedef NS_ENUM(NSInteger, OIMMessageContentType) { OIMMessageContentTypeGroupHasReadReceipt = 116, /// 群聊已读回执 OIMMessageContentTypeAdvancedText = 117, /// Advanced消息 OIMMessageContentTypeAdvancedRevoke = 118, /// 撤回消息类型-新 + OIMMessageContentTypeCustomMsgNotTriggerConversation = 119, /// 后端API会用到 + OIMMessageContentTypeCustomMsgOnlineOnly = 120, /// 后端API会用到 /// 以下皆是通知消息枚举 OIMMessageContentTypeFriendAppApproved = 1201, /// 同意加好友申请通知 OIMMessageContentTypeFriendAppRejected = 1202, /// 拒绝加好友申请通知