HyphenateChatSDK 4.20.0
EMChatMessage.h
1
15#import <Foundation/Foundation.h>
16
17#import "EMMessageBody.h"
18#import "EMMessageReaction.h"
19#import "EMStreamChunk.h"
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) {
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
97typedef 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) BOOL isReadAcked;
284
298@property (nonatomic) BOOL isChatThreadMessage;
299
313@property (nonatomic) BOOL isNeedGroupAck;
314
322@property (nonatomic, readonly) int groupAckCount;
323
349@property (nonatomic) BOOL isDeliverAcked;
350
364@property (nonatomic) BOOL isRead;
365
379@property (nonatomic) BOOL isListened;
380
388@property (nonatomic, strong) EMMessageBody * _Nonnull body;
389
397@property (nonatomic, readonly) NSArray <EMMessageReaction *>* _Nullable reactionList;
398
414- (EMMessageReaction *_Nullable)getReaction:(NSString * _Nonnull)reaction;
415
427@property (nonatomic, copy) NSDictionary * _Nullable ext;
440@property (readonly) EMChatThread * _Nullable chatThread;
455@property (nonatomic) EMChatRoomMessagePriority priority;
456
467@property (nonatomic,readonly) BOOL broadcast;
468
483@property (nonatomic) BOOL deliverOnlineOnly;
484
498@property (nonatomic,strong) NSArray<NSString*>* _Nullable receiverList;
499
510@property (nonatomic,readonly) BOOL isContentReplaced;
519@property (nonatomic,readonly) CGFloat progress;
520
535@property (nonatomic,readonly) EMMessagePinInfo* _Nullable pinnedInfo;
536
541@property (nonatomic,readonly) EMStreamChunk * _Nullable streamChunk;
542
547@property (nonatomic, readonly) EMMessageSenderInfo* _Nullable senderInfo;
573- (instancetype _Nonnull)initWithConversationID:(NSString *_Nonnull)aConversationId
574 from:(NSString *_Nonnull)aFrom
575 to:(NSString *_Nonnull)aTo
576 body:(EMMessageBody *_Nonnull)aBody
577 ext:(NSDictionary *_Nullable)aExt;
578
600- (instancetype _Nonnull)initWithConversationID:(NSString *_Nonnull)aConversationId
601 body:(EMMessageBody *_Nonnull)aBody
602 ext:(NSDictionary *_Nullable)aExt;
603
604@end
Definition: EMChatMessage.h:155
NSArray< EMMessageReaction * > *_Nullable reactionList
Definition: EMChatMessage.h:397
BOOL isReadAcked
Definition: EMChatMessage.h:283
BOOL isNeedGroupAck
Definition: EMChatMessage.h:313
BOOL isContentReplaced
Definition: EMChatMessage.h:510
NSDictionary *_Nullable ext
Definition: EMChatMessage.h:427
NSString *_Nonnull conversationId
Definition: EMChatMessage.h:174
CGFloat progress
Definition: EMChatMessage.h:519
BOOL isChatThreadMessage
Definition: EMChatMessage.h:298
NSString *_Nonnull from
Definition: EMChatMessage.h:192
BOOL deliverOnlineOnly
Definition: EMChatMessage.h:483
BOOL onlineState
Definition: EMChatMessage.h:268
BOOL isDeliverAcked
Definition: EMChatMessage.h:349
EMMessageSenderInfo *_Nullable senderInfo
Definition: EMChatMessage.h:547
NSString *_Nonnull messageId
Definition: EMChatMessage.h:165
long long localTime
Definition: EMChatMessage.h:225
EMChatThread *_Nullable chatThread
Definition: EMChatMessage.h:440
BOOL isRead
Definition: EMChatMessage.h:364
int groupAckCount
Definition: EMChatMessage.h:322
EMMessageStatus status
Definition: EMChatMessage.h:243
NSString *_Nonnull to
Definition: EMChatMessage.h:201
long long timestamp
Definition: EMChatMessage.h:212
EMStreamChunk *_Nullable streamChunk
Definition: EMChatMessage.h:541
EMMessageDirection direction
Definition: EMChatMessage.h:183
BOOL isListened
Definition: EMChatMessage.h:379
BOOL broadcast
Definition: EMChatMessage.h:467
EMChatType chatType
Definition: EMChatMessage.h:234
EMChatRoomMessagePriority priority
Definition: EMChatMessage.h:455
EMMessagePinInfo *_Nullable pinnedInfo
Definition: EMChatMessage.h:535
EMMessageBody *_Nonnull body
Definition: EMChatMessage.h:388
NSArray< NSString * > *_Nullable receiverList
Definition: EMChatMessage.h:498
Definition: EMChatThread.h:22
Definition: EMMessageBody.h:46
Definition: EMChatMessage.h:83
NSString *_Nonnull operatorId
Definition: EMChatMessage.h:84
NSInteger pinTime
Definition: EMChatMessage.h:86
Definition: EMMessageReaction.h:21
Definition: EMChatMessage.h:113
Definition: EMStreamChunk.h:42