HyphenateChatSDK  5.0.0
EMChatMessage.h
1 
15 #import <Foundation/Foundation.h>
16 
17 #import "EMMessageBody.h"
18 #import "EMMessageReaction.h"
19 #import "EMStreamChunk.h"
27 typedef NS_ENUM(NSInteger, EMChatType) {
28  EMChatTypeChat = 0,
29  EMChatTypeGroupChat,
30  EMChatTypeChatRoom,
31 };
32 
40 typedef NS_ENUM(NSInteger, EMMessageStatus) {
41  EMMessageStatusPending = 0,
42  EMMessageStatusDelivering,
43  EMMessageStatusSucceed,
44  EMMessageStatusFailed,
45 };
46 
54 typedef NS_ENUM(NSInteger, EMMessageDirection) {
55  EMMessageDirectionSend = 0,
56  EMMessageDirectionReceive,
57 };
58 
66 typedef NS_ENUM(NSInteger, EMChatRoomMessagePriority) {
68  EMChatRoomMessagePriorityHigh = 0,
70  EMChatRoomMessagePriorityNormal,
72  EMChatRoomMessagePriorityLow,
73 };
74 
82 @interface EMMessagePinInfo: NSObject
84 @property (strong,nonatomic) NSString* _Nonnull operatorId;
86 @property (nonatomic) NSInteger pinTime;
87 
88 @end
89 
97 typedef NS_ENUM(NSInteger, EMMessagePinOperation) {
99  EMMessagePin = 0,
100 
102  EMMessageUnpin
103 };
104 
112 @interface EMMessageSenderInfo: NSObject
118 @property (strong,nonatomic) NSString* _Nullable userId;
124 @property (strong,nonatomic) NSString* _Nullable nickname;
130 @property (strong,nonatomic) NSString* _Nullable avatarUrl;
136 @property (strong,nonatomic) NSString* _Nullable remark;
142 @property (strong,nonatomic) NSString* _Nullable groupNameCard;
143 
144 @end
145 
146 @class EMChatThread;
154 @interface EMChatMessage : NSObject
155 
156 -(instancetype _Nonnull ) init __attribute__((unavailable("call initWithConversationID instead")));
157 
165 @property (nonatomic, copy) NSString * _Nonnull messageId;
166 
174 @property (nonatomic, copy) NSString * _Nonnull conversationId;
175 
183 @property (nonatomic) EMMessageDirection direction;
184 
192 @property (nonatomic, copy) NSString * _Nonnull from;
193 
201 @property (nonatomic, copy) NSString * _Nonnull to;
202 
212 @property (nonatomic) long long timestamp;
213 
225 @property (nonatomic) long long localTime;
226 
234 @property (nonatomic) EMChatType chatType;
235 
243 @property (nonatomic) EMMessageStatus status;
244 
268 @property (nonatomic, readonly) BOOL onlineState;
269 
283 @property (nonatomic,readonly) BOOL isPeerRead;
284 
298 @property (nonatomic) BOOL isChatThreadMessage;
299 
318 @property (nonatomic) BOOL isNeedReadReceipt;
319 
327 @property (nonatomic, readonly) int groupReadReceiptCount;
328 
354 @property (nonatomic) BOOL isDeliverAcked;
355 
369 @property (nonatomic,readonly) BOOL isRead;
370 
384 @property (nonatomic) BOOL isListened;
385 
395 @property (nonatomic, strong) EMMessageBody * _Nonnull body;
396 
406 @property (nonatomic, strong) NSArray<EMMessageBody *> * _Nonnull bodies;
407 
415 @property (nonatomic, readonly) EMMessageBodyType contentType;
416 
424 - (void)appendBody:(EMMessageBody * _Nonnull)body;
425 
433 @property (nonatomic, readonly) NSArray <EMMessageReaction *>* _Nullable reactionList;
434 
446 @property (nonatomic, copy) NSDictionary * _Nullable ext;
459 @property (readonly) EMChatThread * _Nullable chatThread;
474 @property (nonatomic) EMChatRoomMessagePriority priority;
475 
486 @property (nonatomic,readonly) BOOL broadcast;
487 
502 @property (nonatomic) BOOL deliverOnlineOnly;
503 
521 @property (nonatomic, copy) NSString * _Nullable webhookEnv;
522 
536 @property (nonatomic,strong) NSArray<NSString*>* _Nullable receiverList;
537 
548 @property (nonatomic,readonly) BOOL isContentReplaced;
557 @property (nonatomic,readonly) CGFloat progress;
558 
573 @property (nonatomic,readonly) EMMessagePinInfo* _Nullable pinnedInfo;
574 
579 @property (nonatomic,readonly) EMStreamChunk * _Nullable streamChunk;
580 
585 @property (nonatomic, readonly) EMMessageSenderInfo* _Nullable senderInfo;
611 - (instancetype _Nonnull)initWithConversationID:(NSString *_Nonnull)aConversationId
612  from:(NSString *_Nonnull)aFrom
613  to:(NSString *_Nonnull)aTo
614  body:(EMMessageBody *_Nonnull)aBody
615  ext:(NSDictionary *_Nullable)aExt;
616 
638 - (instancetype _Nonnull)initWithConversationID:(NSString *_Nonnull)aConversationId
639  body:(EMMessageBody *_Nonnull)aBody
640  ext:(NSDictionary *_Nullable)aExt;
641 
657 - (instancetype _Nullable)initWithConversationID:(NSString *_Nonnull)aConversationId
658  bodies:(NSArray<EMMessageBody *> *_Nonnull)aBodies
659  ext:(NSDictionary *_Nullable)aExt;
660 
661 @end
BOOL isRead
Definition: EMChatMessage.h:369
NSString *_Nullable webhookEnv
Definition: EMChatMessage.h:521
NSInteger pinTime
Definition: EMChatMessage.h:86
int groupReadReceiptCount
Definition: EMChatMessage.h:327
NSArray< EMMessageReaction * > *_Nullable reactionList
Definition: EMChatMessage.h:433
NSArray< NSString * > *_Nullable receiverList
Definition: EMChatMessage.h:536
BOOL isDeliverAcked
Definition: EMChatMessage.h:354
EMMessageStatus status
Definition: EMChatMessage.h:243
EMMessageBody *_Nonnull body
Definition: EMChatMessage.h:395
Definition: EMMessageBody.h:56
Definition: EMChatMessage.h:154
NSString *_Nonnull from
Definition: EMChatMessage.h:192
EMMessageDirection direction
Definition: EMChatMessage.h:183
EMMessageBodyType contentType
Definition: EMChatMessage.h:415
EMMessagePinInfo *_Nullable pinnedInfo
Definition: EMChatMessage.h:573
NSString *_Nonnull to
Definition: EMChatMessage.h:201
BOOL isContentReplaced
Definition: EMChatMessage.h:548
EMChatThread *_Nullable chatThread
Definition: EMChatMessage.h:459
NSString *_Nonnull messageId
Definition: EMChatMessage.h:165
BOOL isPeerRead
Definition: EMChatMessage.h:283
EMStreamChunk *_Nullable streamChunk
Definition: EMChatMessage.h:579
BOOL isListened
Definition: EMChatMessage.h:384
NSDictionary *_Nullable ext
Definition: EMChatMessage.h:446
Definition: EMChatThread.h:21
BOOL isChatThreadMessage
Definition: EMChatMessage.h:298
BOOL deliverOnlineOnly
Definition: EMChatMessage.h:502
BOOL isNeedReadReceipt
Definition: EMChatMessage.h:318
EMChatRoomMessagePriority priority
Definition: EMChatMessage.h:474
EMChatType chatType
Definition: EMChatMessage.h:234
EMMessageSenderInfo *_Nullable senderInfo
Definition: EMChatMessage.h:585
BOOL onlineState
Definition: EMChatMessage.h:268
NSString *_Nonnull operatorId
Definition: EMChatMessage.h:84
Definition: EMStreamChunk.h:41
long long localTime
Definition: EMChatMessage.h:225
CGFloat progress
Definition: EMChatMessage.h:557
BOOL broadcast
Definition: EMChatMessage.h:486
long long timestamp
Definition: EMChatMessage.h:212
NSString *_Nonnull conversationId
Definition: EMChatMessage.h:174
NSArray< EMMessageBody * > *_Nonnull bodies
Definition: EMChatMessage.h:406
Definition: EMChatMessage.h:82
Definition: EMChatMessage.h:112