HyphenateChatSDK 4.0.0
EMChatMessage.h
1
15#import <Foundation/Foundation.h>
16
17#import "EMMessageBody.h"
18#import "EMMessageReaction.h"
19
27typedef NS_ENUM(NSInteger, EMChatType) {
28 EMChatTypeChat = 0,
29 EMChatTypeGroupChat,
30 EMChatTypeChatRoom,
31};
32
40typedef NS_ENUM(NSInteger, EMMessageStatus) {
41 EMMessageStatusPending = 0,
42 EMMessageStatusDelivering,
43 EMMessageStatusSucceed,
44 EMMessageStatusFailed,
45};
46
54typedef NS_ENUM(NSInteger, EMMessageDirection) {
55 EMMessageDirectionSend = 0,
56 EMMessageDirectionReceive,
57};
58
66typedef NS_ENUM(NSInteger, EMChatRoomMessagePriority) {
67 EMChatRoomMessagePriorityHigh = 0, /* \~chinese 高。 \~english High. */
68 EMChatRoomMessagePriorityNormal, /* \~chinese 中。 \~english Normal. */
69 EMChatRoomMessagePriorityLow, /* \~chinese 低。 \~english Low. */
70};
71
72
73@class EMChatThread;
81@interface EMChatMessage : NSObject
82
90@property (nonatomic, copy) NSString * _Nonnull messageId;
91
99@property (nonatomic, copy) NSString * _Nonnull conversationId;
100
108@property (nonatomic) EMMessageDirection direction;
109
117@property (nonatomic, copy) NSString * _Nonnull from;
118
126@property (nonatomic, copy) NSString * _Nonnull to;
127
137@property (nonatomic) long long timestamp;
138
150@property (nonatomic) long long localTime;
151
159@property (nonatomic) EMChatType chatType;
160
168@property (nonatomic) EMMessageStatus status;
169
193@property (nonatomic, readonly) BOOL onlineState;
194
208@property (nonatomic) BOOL isReadAcked;
209
223@property (nonatomic) BOOL isChatThreadMessage;
224
238@property (nonatomic) BOOL isNeedGroupAck;
239
247@property (nonatomic, readonly) int groupAckCount;
248
274@property (nonatomic) BOOL isDeliverAcked;
275
289@property (nonatomic) BOOL isRead;
290
304@property (nonatomic) BOOL isListened;
305
313@property (nonatomic, strong) EMMessageBody * _Nonnull body;
314
322@property (nonatomic, readonly) NSArray <EMMessageReaction *>* _Nullable reactionList;
323
339- (EMMessageReaction *_Nullable)getReaction:(NSString * _Nonnull)reaction;
340
352@property (nonatomic, copy) NSDictionary * _Nullable ext;
365@property (readonly) EMChatThread * _Nullable chatThread;
380@property (nonatomic) EMChatRoomMessagePriority priority;
381
407- (id _Nonnull )initWithConversationID:(NSString *_Nonnull)aConversationId
408 from:(NSString *_Nonnull)aFrom
409 to:(NSString *_Nonnull)aTo
410 body:(EMMessageBody *_Nonnull)aBody
411 ext:(NSDictionary *_Nullable)aExt;
412
434- (id _Nonnull )initWithConversationID:(NSString *_Nonnull)aConversationId
435 body:(EMMessageBody *_Nonnull)aBody
436 ext:(NSDictionary *_Nullable)aExt;
437
438@end
Definition: EMChatMessage.h:82
NSArray< EMMessageReaction * > *_Nullable reactionList
Definition: EMChatMessage.h:322
BOOL isReadAcked
Definition: EMChatMessage.h:208
BOOL isNeedGroupAck
Definition: EMChatMessage.h:238
NSDictionary *_Nullable ext
Definition: EMChatMessage.h:352
NSString *_Nonnull conversationId
Definition: EMChatMessage.h:99
BOOL isChatThreadMessage
Definition: EMChatMessage.h:223
NSString *_Nonnull from
Definition: EMChatMessage.h:117
BOOL onlineState
Definition: EMChatMessage.h:193
BOOL isDeliverAcked
Definition: EMChatMessage.h:274
NSString *_Nonnull messageId
Definition: EMChatMessage.h:90
long long localTime
Definition: EMChatMessage.h:150
EMChatThread *_Nullable chatThread
Definition: EMChatMessage.h:365
BOOL isRead
Definition: EMChatMessage.h:289
int groupAckCount
Definition: EMChatMessage.h:247
EMMessageStatus status
Definition: EMChatMessage.h:168
NSString *_Nonnull to
Definition: EMChatMessage.h:126
long long timestamp
Definition: EMChatMessage.h:137
EMMessageDirection direction
Definition: EMChatMessage.h:108
BOOL isListened
Definition: EMChatMessage.h:304
EMChatType chatType
Definition: EMChatMessage.h:159
EMChatRoomMessagePriority priority
Definition: EMChatMessage.h:380
EMMessageBody *_Nonnull body
Definition: EMChatMessage.h:313
Definition: EMChatThread.h:22
Definition: EMMessageBody.h:45
Definition: EMMessageReaction.h:21