HyphenateSDK  3.1.3
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  EMMessageSearchDirectionDownload
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)deleteMessageWithId:(NSString *)aMessageId;
133 
145 - (BOOL)deleteAllMessages;
146 
162 - (BOOL)updateMessage:(EMMessage *)aMessage;
163 
179 - (BOOL)markMessageAsReadWithId:(NSString *)aMessageId;
180 
192 - (BOOL)markAllMessagesAsRead;
193 
205 - (BOOL)updateConversationExtToDB __deprecated_msg("setExt: will update extend properties to DB");
206 
222 - (EMMessage *)loadMessageWithId:(NSString *)aMessageId;
223 
243 - (NSArray *)loadMoreMessagesFromId:(NSString *)aMessageId
244  limit:(int)aLimit
245  direction:(EMMessageSearchDirection)aDirection;
246 
270 - (NSArray *)loadMoreMessagesWithType:(EMMessageBodyType)aType
271  before:(long long)aTimestamp
272  limit:(int)aLimit
273  from:(NSString*)aSender
274  direction:(EMMessageSearchDirection)aDirection;
275 
299 - (NSArray *)loadMoreMessagesContain:(NSString*)aKeywords
300  before:(long long)aTimestamp
301  limit:(int)aLimit
302  from:(NSString*)aSender
303  direction:(EMMessageSearchDirection)aDirection;
304 
324 - (NSArray *)loadMoreMessagesFrom:(long long)aStartTimestamp
325  to:(long long)aEndTimestamp
326  maxCount:(int)aMaxCount;
327 
340 
341 
342 @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()