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"
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,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
393@property (nonatomic, strong) EMMessageBody * _Nonnull body;
394
402@property (nonatomic, readonly) NSArray <EMMessageReaction *>* _Nullable reactionList;
403
415@property (nonatomic, copy) NSDictionary * _Nullable ext;
428@property (readonly) EMChatThread * _Nullable chatThread;
443@property (nonatomic) EMChatRoomMessagePriority priority;
444
455@property (nonatomic,readonly) BOOL broadcast;
456
471@property (nonatomic) BOOL deliverOnlineOnly;
472
490@property (nonatomic, copy) NSString * _Nullable webhookEnv;
491
505@property (nonatomic,strong) NSArray<NSString*>* _Nullable receiverList;
506
517@property (nonatomic,readonly) BOOL isContentReplaced;
526@property (nonatomic,readonly) CGFloat progress;
527
542@property (nonatomic,readonly) EMMessagePinInfo* _Nullable pinnedInfo;
543
548@property (nonatomic,readonly) EMStreamChunk * _Nullable streamChunk;
549
554@property (nonatomic, readonly) EMMessageSenderInfo* _Nullable senderInfo;
580- (instancetype _Nonnull)initWithConversationID:(NSString *_Nonnull)aConversationId
581 from:(NSString *_Nonnull)aFrom
582 to:(NSString *_Nonnull)aTo
583 body:(EMMessageBody *_Nonnull)aBody
584 ext:(NSDictionary *_Nullable)aExt;
585
607- (instancetype _Nonnull)initWithConversationID:(NSString *_Nonnull)aConversationId
608 body:(EMMessageBody *_Nonnull)aBody
609 ext:(NSDictionary *_Nullable)aExt;
610
611@end
Definition: EMChatMessage.h:155
NSArray< EMMessageReaction * > *_Nullable reactionList
Definition: EMChatMessage.h:402
BOOL isNeedReadReceipt
Definition: EMChatMessage.h:318
BOOL isContentReplaced
Definition: EMChatMessage.h:517
NSString *_Nullable webhookEnv
Definition: EMChatMessage.h:490
NSDictionary *_Nullable ext
Definition: EMChatMessage.h:415
NSString *_Nonnull conversationId
Definition: EMChatMessage.h:174
CGFloat progress
Definition: EMChatMessage.h:526
BOOL isChatThreadMessage
Definition: EMChatMessage.h:298
NSString *_Nonnull from
Definition: EMChatMessage.h:192
BOOL deliverOnlineOnly
Definition: EMChatMessage.h:471
BOOL onlineState
Definition: EMChatMessage.h:268
BOOL isDeliverAcked
Definition: EMChatMessage.h:354
EMMessageSenderInfo *_Nullable senderInfo
Definition: EMChatMessage.h:554
NSString *_Nonnull messageId
Definition: EMChatMessage.h:165
long long localTime
Definition: EMChatMessage.h:225
BOOL isPeerRead
Definition: EMChatMessage.h:283
EMChatThread *_Nullable chatThread
Definition: EMChatMessage.h:428
BOOL isRead
Definition: EMChatMessage.h:369
int groupReadReceiptCount
Definition: EMChatMessage.h:327
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:548
EMMessageDirection direction
Definition: EMChatMessage.h:183
BOOL isListened
Definition: EMChatMessage.h:384
BOOL broadcast
Definition: EMChatMessage.h:455
EMChatType chatType
Definition: EMChatMessage.h:234
EMChatRoomMessagePriority priority
Definition: EMChatMessage.h:443
EMMessagePinInfo *_Nullable pinnedInfo
Definition: EMChatMessage.h:542
EMMessageBody *_Nonnull body
Definition: EMChatMessage.h:393
NSArray< NSString * > *_Nullable receiverList
Definition: EMChatMessage.h:505
Definition: EMChatThread.h:22
Definition: EMMessageBody.h:55
Definition: EMChatMessage.h:83
NSString *_Nonnull operatorId
Definition: EMChatMessage.h:84
NSInteger pinTime
Definition: EMChatMessage.h:86
Definition: EMChatMessage.h:113
Definition: EMStreamChunk.h:42