Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
std-s committed Aug 3, 2022
2 parents 93d7a15 + 2cf26b6 commit df314af
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 7 deletions.
2 changes: 1 addition & 1 deletion OpenIMSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Group.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 18 additions & 1 deletion OpenIMSDK/Interface/OIMManager+Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,20 @@ NS_ASSUME_NONNULL_BEGIN


/*
* 创建动图消息
* 创建高级消息
*
*/
+ (OIMMessageInfo *)createAdvancedTextMessage:(NSString *)text
messageEntityList:(NSArray <OIMMessageEntity *> *)messageEntityList;

/*
* 创建高级引用消息
*
*/
+ (OIMMessageInfo *)createAdvancedQuoteMessage:(NSString *)text
message:(OIMMessageInfo *)message
messageEntityList:(NSArray <OIMMessageEntity *> *)messageEntityList;

@end

@interface OIMManager (Message)
Expand Down Expand Up @@ -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
21 changes: 21 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Message.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ + (OIMMessageInfo *)createAdvancedTextMessage:(NSString *)text
return [self convertToMessageInfo:json];
}

+ (OIMMessageInfo *)createAdvancedQuoteMessage:(NSString *)text
message:(OIMMessageInfo *)message
messageEntityList:(NSArray<OIMMessageEntity *> *)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)
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion OpenIMSDK/Model/OIMAttachedInfoElem.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, assign) BOOL notSenderNotificationPush;

@property (nonatomic, strong) NSArray <OIMMessageEntity *> *messageEntityList;
@property (nonatomic, copy) NSArray <OIMMessageEntity *> *messageEntityList;
@end

NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions OpenIMSDK/Model/OIMMergeElem.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

#import <Foundation/Foundation.h>
#import "OIMMessageElem.h"
@class OIMMessageInfo;

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -15,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, nullable, copy) NSString *title;
@property (nonatomic, nullable, copy) NSArray<NSString *> *abstractList;
@property (nonatomic, nullable, copy) NSArray<OIMMessageInfo *> *multiMessage;
@property (nonatomic, nullable, copy) NSArray<OIMMessageEntity *> *messageEntityList;

@end

Expand Down
3 changes: 2 additions & 1 deletion OpenIMSDK/Model/OIMMergeElem.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ @implementation OIMMergeElem

+ (NSDictionary *)mj_objectClassInArray
{
return @{@"multiMessage" : [OIMMessageInfo class]};
return @{@"multiMessage" : [OIMMessageInfo class],
@"messageEntityList" : [OIMMessageEntity class]};
}

@end
2 changes: 1 addition & 1 deletion OpenIMSDK/Model/OIMMessageElem.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface OIMMessageEntityElem : NSObject

@property (nonatomic, copy) NSString *text;
@property (nonatomic, strong) NSArray <OIMMessageEntity *> *messageEntityList;
@property (nonatomic, copy) NSArray <OIMMessageEntity *> *messageEntityList;

@end

Expand Down
3 changes: 2 additions & 1 deletion OpenIMSDK/Model/OIMQuoteElem.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#import <Foundation/Foundation.h>

#import "OIMMessageElem.h"
@class OIMMessageInfo;

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -17,6 +17,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, nullable, strong) OIMMessageInfo *quoteMessage;

@property (nonatomic, nullable, copy) NSArray <OIMMessageEntity *> *messageEntityList;
@end

NS_ASSUME_NONNULL_END
5 changes: 5 additions & 0 deletions OpenIMSDK/Model/OIMQuoteElem.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@

@implementation OIMQuoteElem

+ (NSDictionary *)mj_objectClassInArray
{
return @{@"messageEntityList" : [OIMMessageEntity class]};
}

@end
27 changes: 27 additions & 0 deletions OpenIMSDK/Model/OIMSearchParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ NS_ASSUME_NONNULL_BEGIN

@end


@interface OIMFindMessageListParam : NSObject

@property (nonatomic, copy) NSString *conversationID;

@property (nonatomic, copy) NSArray <NSString *> *clientMsgIDList;

@end

// 查询组织架构使用
@interface OIMSearchOrganizationParam : NSObject

Expand Down Expand Up @@ -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
8 changes: 8 additions & 0 deletions OpenIMSDK/Model/OIMSearchParam.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ @implementation OIMSearchUserParam

@end

@implementation OIMFindMessageListParam

@end

@implementation OIMSearchGroupMembersParam

@end

@implementation OIMSearchOrganizationParam

@end
10 changes: 10 additions & 0 deletions OpenIMSDK/Model/OIMSearchResultInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

#import <Foundation/Foundation.h>
#import "OIMModelDefine.h"

@class OIMMessageInfo;

Expand All @@ -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的列表
*/
Expand All @@ -42,6 +49,9 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, copy) NSArray <OIMSearchResultItemInfo *> *searchResultItems;

// 仅适用于findMessageList函数的回调结果
@property (nonatomic, copy) NSArray <OIMSearchResultItemInfo *> *findResultItems;

@end

@interface OIMGetAdvancedHistoryMessageListInfo : NSObject
Expand Down
9 changes: 8 additions & 1 deletion OpenIMSDK/Model/OIMSearchResultInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions OpenIMSDK/Utils/OIMModelDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, /// 拒绝加好友申请通知
Expand Down

0 comments on commit df314af

Please sign in to comment.