15#import <Foundation/Foundation.h>
17#import "EMMessageBody.h"
18#import "EMCursorResult.h"
19#import "EMSilentModeParam.h"
28typedef NS_ENUM(NSInteger, EMConversationType) {
29 EMConversationTypeChat = 0,
30 EMConversationTypeGroupChat,
31 EMConversationTypeChatRoom,
45typedef NS_ENUM(NSInteger, EMMarkType) {
86typedef NS_ENUM(NSInteger, EMMessageSearchDirection) {
87 EMMessageSearchDirectionUp = 0,
88 EMMessageSearchDirectionDown
98typedef NS_ENUM(NSInteger, EMMessageSearchScope) {
99 EMMessageSearchScopeContent = 0,
100 EMMessageSearchScopeExt,
101 EMMessageSearchScopeAll
138@property (nonatomic, assign, readonly) EMConversationType
type;
169@property (nonatomic, copy) NSDictionary *
ext;
222@property (nonatomic, readonly) NSArray<NSNumber*>*
marks;
269 error:(
EMError ** _Nullable)pError;
294 error:(
EMError **_Nullable)pError;
310- (void)deleteMessageWithId:(NSString *_Nonnull)aMessageId
311 error:(
EMError ** _Nullable)pError;
324- (void)deleteAllMessages:(
EMError ** _Nullable)pError;
343- (void)removeMessagesFromServerMessageIds:(NSArray <__kindof NSString*>*_Nonnull)messageIds completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
360- (void)removeMessagesFromServerWithTimeStamp:(NSTimeInterval)beforeTimeStamp completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
383 error:(
EMError ** _Nullable)pError;
399- (void)markMessageAsReadWithId:(NSString *_Nonnull)aMessageId
400 error:(
EMError ** _Nullable)pError;
414- (void)markAllMessagesAsRead:(
EMError ** _Nullable)pError;
426#pragma mark - Load Messages Methods
442- (
EMChatMessage * _Nullable)loadMessageWithId:(NSString * _Nonnull)aMessageId
443 error:(
EMError ** _Nullable)pError;
475- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesStartFromId:(NSString * _Nullable)aMessageId
477 searchDirection:(EMMessageSearchDirection)aDirection;
505- (void)loadMessagesStartFromId:(NSString * _Nullable)aMessageId
507 searchDirection:(EMMessageSearchDirection)aDirection
508 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
538- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesWithType:(EMMessageBodyType)aType
539 timestamp:(
long long)aTimestamp
541 fromUser:(NSString* _Nullable)aUsername
542 searchDirection:(EMMessageSearchDirection)aDirection;
566- (void)loadMessagesWithType:(EMMessageBodyType)aType
567 timestamp:(
long long)aTimestamp
569 fromUser:(NSString* _Nullable)aUsername
570 searchDirection:(EMMessageSearchDirection)aDirection
571 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
594- (void)searchMessagesWithTypes:(NSArray <NSNumber*> *_Nonnull)aTypes
595 timestamp:(
long long)aTimestamp
597 fromUser:(NSString* _Nullable)aUsername
598 searchDirection:(EMMessageSearchDirection)aDirection
599 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
630- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesWithKeyword:(NSString* _Nullable)aKeyword
631 timestamp:(
long long)aTimestamp
633 fromUser:(NSString* _Nullable)aSender
634 searchDirection:(EMMessageSearchDirection)aDirection;
659- (void)loadMessagesWithKeyword:(NSString* _Nullable)aKeyword
660 timestamp:(
long long)aTimestamp
662 fromUser:(NSString* _Nullable)aSender
663 searchDirection:(EMMessageSearchDirection)aDirection
664 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
697- (void)loadMessagesWithKeyword:(NSString* _Nullable)aKeyword
698 timestamp:(
long long)aTimestamp
700 fromUser:(NSString* _Nullable)aSender
701 searchDirection:(EMMessageSearchDirection)aDirection
702 scope:(EMMessageSearchScope)aScope
703 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
734- (NSArray<
EMChatMessage *> * _Nullable)loadCustomMsgWithKeyword:(NSString*)aKeyword
735 timestamp:(
long long)aTimestamp
737 fromUser:(NSString* _Nullable)aSender
738 searchDirection:(EMMessageSearchDirection)aDirection;
763- (void)loadCustomMsgWithKeyword:(NSString* _Nullable)aKeyword
764 timestamp:(
long long)aTimestamp
766 fromUser:(NSString* _Nullable)aSender
767 searchDirection:(EMMessageSearchDirection)aDirection
768 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
799- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesFrom:(
long long)aStartTimestamp
800 to:(
long long)aEndTimestamp
821- (void)loadMessagesFrom:(
long long)aStartTimestamp
822 to:(
long long)aEndTimestamp
824 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
846- (
EMError* _Nullable)removeMessagesStart:(NSInteger)aStartTimestamp
847 to:(NSInteger)aEndTimestamp;
864- (NSInteger)getMessageCountStart:(NSInteger)aStartTimestamp
865 to:(NSInteger)aEndTimestamp;
Definition: EMChatMessage.h:114
Definition: EMConversation.h:115
NSDictionary * ext
Definition: EMConversation.h:169
int64_t pinnedTime
Definition: EMConversation.h:204
int messagesCount
Definition: EMConversation.h:156
BOOL isChatThread
Definition: EMConversation.h:182
EMChatMessage * latestMessage
Definition: EMConversation.h:213
EMConversationType type
Definition: EMConversation.h:138
NSArray< NSNumber * > * marks
Definition: EMConversation.h:222
NSArray< EMChatMessage * > *_Nullable pinnedMessages()
BOOL isPinned
Definition: EMConversation.h:195
EMPushRemindType disturbType
Definition: EMConversation.h:231
int unreadMessagesCount
Definition: EMConversation.h:147
NSString * conversationId
Definition: EMConversation.h:129
EMChatMessage *_Nullable lastReceivedMessage()