NIMSDK-iOS
载入中...
搜索中...
未找到
NIMQChatMessage.h
浏览该文件的文档.
1//
2// NIMQChatMessage.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright © 2022 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@class NIMMessage;
12@class NIMSession;
19@protocol NIMMessageObject;
20NS_ASSUME_NONNULL_BEGIN
21
22/**
23 * 消息处理状态
24 */
25typedef NS_ENUM(NSInteger, NIMQChatMessageStatus) {
26 /**
27 * 初始状态
28 * @discussion
29 */
31
32 /**
33 * 已撤回
34 * @discussion
35 */
37
38 /**
39 * 已删除
40 * @discussion
41 */
43
44 /**
45 * 自定义
46 * @discussion 自定义状态值必须大于10000
47 */
49};
50
51/**
52 * 消息结构
53 */
54@interface NIMQChatMessage : NSObject
55
56/**
57 * 消息类型
58 */
59@property (nonatomic,assign,readonly) NSInteger messageType;
60
61/**
62 * 消息所属会话
63 */
64@property (nullable,nonatomic,copy,readonly) NIMSession *session;
65
66/**
67 * 消息ID,唯一标识
68 */
69@property (nonatomic,copy,readonly) NSString *messageId;
70
71/**
72 * 消息服务端ID
73 */
74@property (nonatomic,copy,readonly) NSString *serverID;
75
76/**
77 * 消息文本
78 * @discussion 所有消息类型都支持
79 */
80@property (nullable,nonatomic,copy) NSString *text;
81
82/**
83 * 消息附件内容
84 */
85@property (nullable,nonatomic,strong) id<NIMMessageObject> messageObject;
86
87
88/**
89 * 消息附件原始字符串内容
90 */
91@property (nullable, nonatomic, copy, readonly) NSString *rawAttachContent;
92
93/**
94 * 消息设置
95 * @discussion 可以通过这个字段制定当前消息的各种设置
96 */
97@property (nullable,nonatomic,strong) NIMMessageSetting *setting;
98
99/**
100 * 消息推送文案,长度限制500字,撤回消息时该字段无效
101 */
102@property (nullable,nonatomic,copy) NSString *apnsContent;
103
104/**
105 * 消息推送Payload
106 * @discussion 可以通过这个字段定义消息推送 Payload ,支持字段参考苹果技术文档,长度限制 2K,撤回消息时该字段无效
107 */
108@property (nullable,nonatomic,copy) NSDictionary *apnsPayload;
109
110/**
111 * 服务器扩展
112 * @discussion 客户端可以设置这个字段,这个字段将在本地存储且发送至对端,上层需要保证 NSDictionary 可以转换为 JSON,长度限制 1K
113 */
114@property (nullable,nonatomic,copy) NSDictionary *remoteExt;
115
116/**
117 * 客户端本地扩展
118 * @discussion 客户端可以设置这个字段,这个字段只在本地存储,不会发送至对端,上层需要保证 NSDictionary 可以转换为 JSON
119 */
120@property (nullable,nonatomic,copy) NSDictionary *localExt;
121
122/**
123 * 消息发送时间
124 * @discussion 发送成功后将被服务器自动修正
125 */
126@property (nonatomic,assign) NSTimeInterval timestamp;
127
128/**
129 * 消息投递状态 仅针对发送的消息
130 */
131@property (nonatomic,assign,readonly) NSInteger deliveryState;
132
133/**
134 * 消息附件下载状态 仅针对收到的消息
135 */
136@property (nonatomic,assign,readonly) NSInteger attachmentDownloadState;
137
138/**
139 * 是否是收到的消息
140 * @discussion
141 */
142@property (nonatomic,assign,readonly) BOOL isReceivedMsg;
143
144/**
145 * 是否是往外发的消息
146 * @discussion
147 */
148@property (nonatomic,assign,readonly) BOOL isOutgoingMsg;
149
150/**
151 * 消息是否标记为已删除
152 * @discussion
153 */
154@property (nonatomic,assign,readonly) BOOL isDeleted;
155
156/**
157 * 消息是否标记为已撤回
158 * @discussion
159 */
160@property (nonatomic,assign,readonly) BOOL isRevoked;
161
162/**
163 * 消息处理状态
164 */
165@property (nonatomic,assign) NIMQChatMessageStatus status;
166
167/**
168 * 消息来源
169 */
170@property (nullable,nonatomic,copy) NSString *from;
171
172/**
173 * 消息发送者名字
174 * @discussion
175 */
176@property (nullable,nonatomic,copy,readonly) NSString *senderName;
177
178/**
179 * 发送者客户端类型
180 */
181@property (nonatomic,assign,readonly) NSInteger senderClientType;
182
183/**
184 * 圈组频道ID
185 */
186@property (nonatomic,readonly) unsigned long long qchatChannelId;
187
188/**
189 * 圈组服务器ID
190 */
191@property (nonatomic,readonly) unsigned long long qchatServerId;
192
193/**
194 * 是否艾特所有人
195 * @discussion
196 */
197@property(nonatomic, assign) BOOL mentionedAll;
198
199/**
200 * 被艾特的人的accid列表
201 * @discussion
202 */
203@property(nonatomic, copy) NSArray<NSString *> *mentionedAccids;
204
205/**
206 * 被艾特的身份组的ID列表
207 * @discussion
208 */
209@property(nonatomic, copy) NSArray<NSNumber *> *mentionedRoleidList;
210
211/**
212 * 消息更新时间
213 * @discussion
214 */
215@property(nonatomic, assign) NSTimeInterval updateTimestamp;
216
217
218/**
219* 环境变量
220* @discussion 环境变量,用于指向不同的抄送、第三方回调等配置
221*/
222@property (nullable,nonatomic,copy) NSString *env;
223
224/**
225 * 回复消息引用
226 * @discussion
227 */
228@property(nullable, nonatomic, copy, readonly) NIMQChatMessageRefer *replyRefer;
229
230/**
231 * thread消息引用
232 * @discussion
233 */
234@property(nullable, nonatomic, copy, readonly) NIMQChatMessageRefer *threadRefer;
235
236/**
237 * 是否来自缓存
238 * @discussion
239 */
240@property (nonatomic,assign,readonly) BOOL fromCache;
241
242/**
243 * 易盾反垃圾设置
244 */
245@property (nullable, nonatomic, copy) NIMQChatMessageAntispamSetting *yidunAntiSpamSetting;
246
247/**
248 * 易盾反垃圾返回的结果字段
249 */
250@property (nullable, nonatomic, copy) NIMQChatMessageAntispamResult *yidunAntiSpamResult;
251
252/**
253 * 第三方回调回来的自定义扩展字段
254 */
255@property (nonatomic,copy,readonly) NSString *callbackExt;
256
257/**
258 * 消息更新内容
259 * @discussion 如果是更新的消息,里面有具体更新内容
260 */
261@property (nullable, nonatomic, strong) NIMQChatMessageUpdateContent *updateContent;
262
263/**
264 * 消息更新操作信息
265 * @discussion 如果是更新的消息,里面有具体操作信息
266 */
267@property (nullable, nonatomic, strong) NIMQChatMessageUpdateOperatorInfo *updateOperatorInfo;
268
269/**
270 * 消息子类型, 大于0的int NSNumber包装值
271 */
272@property (nonatomic, strong) NSNumber *subType;
273
274@end
275
276NS_ASSUME_NONNULL_END
NIMQChatMessageStatus
Definition: NIMQChatMessage.h:25
@ NIMQChatMessageStatusInit
Definition: NIMQChatMessage.h:30
@ NIMQChatMessageStatusCustom
Definition: NIMQChatMessage.h:48
@ NIMQChatMessageStatusRevoked
Definition: NIMQChatMessage.h:36
@ NIMQChatMessageStatusDeleted
Definition: NIMQChatMessage.h:42
Definition: NIMMessage.h:90
Definition: NIMMessageSetting.h:17
Definition: NIMQChatMessageAntispamResult.h:16
Definition: NIMQChatMessageAntispamSetting.h:16
Definition: NIMQChatMessage.h:55
NSInteger senderClientType
Definition: NIMQChatMessage.h:181
NSInteger deliveryState
Definition: NIMQChatMessage.h:131
BOOL isRevoked
Definition: NIMQChatMessage.h:160
NIMQChatMessageRefer * replyRefer
Definition: NIMQChatMessage.h:228
NSArray< NSString * > * mentionedAccids
Definition: NIMQChatMessage.h:203
NSNumber * subType
Definition: NIMQChatMessage.h:272
NIMQChatMessageUpdateContent * updateContent
Definition: NIMQChatMessage.h:261
unsigned long long qchatServerId
Definition: NIMQChatMessage.h:191
NIMMessageSetting * setting
Definition: NIMQChatMessage.h:97
BOOL mentionedAll
Definition: NIMQChatMessage.h:197
NIMQChatMessageUpdateOperatorInfo * updateOperatorInfo
Definition: NIMQChatMessage.h:267
NSDictionary * remoteExt
Definition: NIMQChatMessage.h:114
NIMSession * session
Definition: NIMQChatMessage.h:64
NSArray< NSNumber * > * mentionedRoleidList
Definition: NIMQChatMessage.h:209
NSString * from
Definition: NIMQChatMessage.h:170
NSString * apnsContent
Definition: NIMQChatMessage.h:102
NSString * rawAttachContent
Definition: NIMQChatMessage.h:91
NIMQChatMessageAntispamResult * yidunAntiSpamResult
Definition: NIMQChatMessage.h:250
NSString * callbackExt
Definition: NIMQChatMessage.h:255
NSInteger messageType
Definition: NIMQChatMessage.h:59
id< NIMMessageObject > messageObject
Definition: NIMQChatMessage.h:85
BOOL isDeleted
Definition: NIMQChatMessage.h:154
NSString * serverID
Definition: NIMQChatMessage.h:74
NSTimeInterval updateTimestamp
Definition: NIMQChatMessage.h:215
NSString * env
Definition: NIMQChatMessage.h:222
NSDictionary * apnsPayload
Definition: NIMQChatMessage.h:108
NIMQChatMessageStatus status
Definition: NIMQChatMessage.h:165
NIMQChatMessageRefer * threadRefer
Definition: NIMQChatMessage.h:234
BOOL isOutgoingMsg
Definition: NIMQChatMessage.h:148
BOOL isReceivedMsg
Definition: NIMQChatMessage.h:142
NSString * text
Definition: NIMQChatMessage.h:80
NIMQChatMessageAntispamSetting * yidunAntiSpamSetting
Definition: NIMQChatMessage.h:245
NSString * messageId
Definition: NIMQChatMessage.h:69
BOOL fromCache
Definition: NIMQChatMessage.h:240
NSTimeInterval timestamp
Definition: NIMQChatMessage.h:126
NSString * senderName
Definition: NIMQChatMessage.h:176
NSInteger attachmentDownloadState
Definition: NIMQChatMessage.h:136
unsigned long long qchatChannelId
Definition: NIMQChatMessage.h:186
NSDictionary * localExt
Definition: NIMQChatMessage.h:120
Definition: NIMQChatMessageRefer.h:17
Definition: NIMQChatMessageUpdateContent.h:19
Definition: NIMQChatMessageUpdateContent.h:43
Definition: NIMSession.h:49