HyphenateSDK  3.1.4
EMConversation.h
1 
15 #import <Foundation/Foundation.h>
16 
17 #import "EMMessageBody.h"
18 
19 /*
20  * \~chinese
21  * 会话类型
22  *
23  * \~english
24  * Conversation type
25  */
26 typedef enum{
27  EMConversationTypeChat = 0,
28  EMConversationTypeGroupChat,
29  EMConversationTypeChatRoom
30 } EMConversationType;
31 
32 /*
33  * \~chinese
34  * 消息搜索方向
35  *
36  * \~english
37  * Message search direction
38  */
39 typedef enum{
40  EMMessageSearchDirectionUp = 0,
41  EMMessageSearchDirectionDown
42 } EMMessageSearchDirection;
43 
44 @class EMMessage;
45 
53 @interface EMConversation : NSObject
54 
62 @property (nonatomic, copy, readonly) NSString *conversationId;
63 
71 @property (nonatomic, assign, readonly) EMConversationType type;
72 
80 @property (nonatomic, assign, readonly) int unreadMessagesCount;
81 
89 @property (nonatomic, copy) NSDictionary *ext;
90 
98 @property (nonatomic, strong, readonly) EMMessage *latestMessage;
99 
115 - (BOOL)insertMessage:(EMMessage *)aMessage;
116 
132 - (BOOL)appendMessage:(EMMessage *)aMessage;
133 
149 - (BOOL)deleteMessageWithId:(NSString *)aMessageId;
150 
162 - (BOOL)deleteAllMessages;
163 
179 - (BOOL)updateMessage:(EMMessage *)aMessage;
180 
196 - (BOOL)markMessageAsReadWithId:(NSString *)aMessageId;
197 
209 - (BOOL)markAllMessagesAsRead;
210 
222 - (BOOL)updateConversationExtToDB __deprecated_msg("setExt: will update extend properties to DB");
223 
239 - (EMMessage *)loadMessageWithId:(NSString *)aMessageId;
240 
260 - (NSArray *)loadMoreMessagesFromId:(NSString *)aMessageId
261  limit:(int)aLimit
262  direction:(EMMessageSearchDirection)aDirection;
263 
287 - (NSArray *)loadMoreMessagesWithType:(EMMessageBodyType)aType
288  before:(long long)aTimestamp
289  limit:(int)aLimit
290  from:(NSString*)aSender
291  direction:(EMMessageSearchDirection)aDirection;
292 
316 - (NSArray *)loadMoreMessagesContain:(NSString*)aKeywords
317  before:(long long)aTimestamp
318  limit:(int)aLimit
319  from:(NSString*)aSender
320  direction:(EMMessageSearchDirection)aDirection;
321 
341 - (NSArray *)loadMoreMessagesFrom:(long long)aStartTimestamp
342  to:(long long)aEndTimestamp
343  maxCount:(int)aMaxCount;
344 
357 
358 
359 @end
"setExt: will update extend properties to DB" __deprecated_msg()
NSString * conversationId
Definition: EMConversation.h:62
Definition: EMConversation.h:53
int unreadMessagesCount
Definition: EMConversation.h:80
EMConversationType type
Definition: EMConversation.h:71
NSDictionary * ext
Definition: EMConversation.h:89
BOOL markAllMessagesAsRead()
Definition: EMMessage.h:65
EMMessage * latestMessage
Definition: EMConversation.h:98
EMMessage * latestMessageFromOthers()
BOOL deleteAllMessages()