15#import <Foundation/Foundation.h>
17#import "EMMessageBody.h"
26typedef NS_ENUM(NSInteger, EMConversationType) {
27 EMConversationTypeChat = 0,
28 EMConversationTypeGroupChat,
29 EMConversationTypeChatRoom,
39typedef NS_ENUM(NSInteger, EMMessageSearchDirection) {
40 EMMessageSearchDirectionUp = 0,
41 EMMessageSearchDirectionDown
80@property (nonatomic, assign, readonly) EMConversationType
type;
107@property (nonatomic, copy) NSDictionary *
ext;
162 error:(
EMError ** _Nullable)pError;
179 error:(
EMError **_Nullable)pError;
195- (void)deleteMessageWithId:(NSString *_Nonnull)aMessageId
196 error:(
EMError ** _Nullable)pError;
209- (void)deleteAllMessages:(
EMError ** _Nullable)pError;
224- (void)removeMessagesFromServerMessageIds:(NSArray <__kindof NSString*>*_Nonnull)messageIds completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
238- (void)removeMessagesFromServerWithTimeStamp:(NSTimeInterval)beforeTimeStamp completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
259 error:(
EMError ** _Nullable)pError;
275- (void)markMessageAsReadWithId:(NSString *_Nonnull)aMessageId
276 error:(
EMError ** _Nullable)pError;
290- (void)markAllMessagesAsRead:(
EMError ** _Nullable)pError;
293#pragma mark - Load Messages Methods
309- (
EMChatMessage * _Nullable)loadMessageWithId:(NSString * _Nonnull)aMessageId
310 error:(
EMError ** _Nullable)pError;
342- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesStartFromId:(NSString * _Nullable)aMessageId
344 searchDirection:(EMMessageSearchDirection)aDirection;
370- (void)loadMessagesStartFromId:(NSString * _Nullable)aMessageId
372 searchDirection:(EMMessageSearchDirection)aDirection
373 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
407- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesWithType:(EMMessageBodyType)aType
408 timestamp:(
long long)aTimestamp
410 fromUser:(NSString* _Nullable)aUsername
411 searchDirection:(EMMessageSearchDirection)aDirection;
437- (void)loadMessagesWithType:(EMMessageBodyType)aType
438 timestamp:(
long long)aTimestamp
440 fromUser:(NSString* _Nullable)aUsername
441 searchDirection:(EMMessageSearchDirection)aDirection
442 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
474- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesWithKeyword:(NSString* _Nullable)aKeyword
475 timestamp:(
long long)aTimestamp
477 fromUser:(NSString* _Nullable)aSender
478 searchDirection:(EMMessageSearchDirection)aDirection;
504- (void)loadMessagesWithKeyword:(NSString* _Nullable)aKeyword
505 timestamp:(
long long)aTimestamp
507 fromUser:(NSString* _Nullable)aSender
508 searchDirection:(EMMessageSearchDirection)aDirection
509 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
542- (NSArray<
EMChatMessage *> * _Nullable)loadCustomMsgWithKeyword:(NSString*)aKeyword
543 timestamp:(
long long)aTimestamp
545 fromUser:(NSString* _Nullable)aSender
546 searchDirection:(EMMessageSearchDirection)aDirection;
572- (void)loadCustomMsgWithKeyword:(NSString* _Nullable)aKeyword
573 timestamp:(
long long)aTimestamp
575 fromUser:(NSString* _Nullable)aSender
576 searchDirection:(EMMessageSearchDirection)aDirection
577 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
606- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesFrom:(
long long)aStartTimestamp
607 to:(
long long)aEndTimestamp
628- (void)loadMessagesFrom:(
long long)aStartTimestamp
629 to:(
long long)aEndTimestamp
631 completion:(
void (^ _Nullable)(NSArray<
EMChatMessage *> * _Nullable aMessages,
EMError * _Nullable aError))aCompletionBlock;
Definition: EMChatMessage.h:82
Definition: EMConversation.h:55
NSDictionary * ext
Definition: EMConversation.h:107
int messagesCount
Definition: EMConversation.h:98
BOOL isChatThread
Definition: EMConversation.h:116
EMChatMessage * latestMessage
Definition: EMConversation.h:125
EMConversationType type
Definition: EMConversation.h:80
int unreadMessagesCount
Definition: EMConversation.h:89
NSString * conversationId
Definition: EMConversation.h:71
EMChatMessage *_Nullable lastReceivedMessage()