NIM PC Cross Platform SDK
nim_qchat_message_cpp_def.h
Go to the documentation of this file.
1
11#ifndef __NIM_QCHAT_MESSAGE_CPP_DEF_H__
12#define __NIM_QCHAT_MESSAGE_CPP_DEF_H__
13
14#include <iostream>
18
19namespace nim_qchat {
20
23 IQChatAttachInterface() = default;
24 virtual ~IQChatAttachInterface() {}
25 virtual void SetRawData(const std::string& raw_data){};
26 virtual std::string GetRawData() const { return ""; };
27 virtual bool IsFileBased() const { return false; };
28};
29
30struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatDefaultAttach : public IQChatAttachInterface {
31 QChatDefaultAttach() = default;
32 QChatDefaultAttach(const std::string& raw_data) { SetRawData(raw_data); }
33 QChatDefaultAttach(const NIMQChatDefaultAttach& c_param) { msg_attach = c_param.msg_attach ? c_param.msg_attach : ""; }
34 const NIMQChatDefaultAttach ToCParam() {
36 c_param.msg_attach = const_cast<char*>(msg_attach.c_str());
37 return c_param;
38 }
39 void SetRawData(const std::string& raw_data) { msg_attach = raw_data; };
40 std::string GetRawData() const override { return msg_attach; }
41 std::string msg_attach;
42};
43
45struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatFileAttach : public IQChatAttachInterface {
46public:
47 QChatFileAttach() = default;
48 QChatFileAttach(const std::string& raw_data) { SetRawData(raw_data); }
49 QChatFileAttach(const NIMQChatFileAttach& c_param) {
50 file_path = c_param.file_path ? c_param.file_path : "";
51 download_url = c_param.url ? c_param.url : "";
52 hash = c_param.md5 ? c_param.md5 : "";
53 extension = c_param.ext ? c_param.ext : "";
54 name = c_param.name ? c_param.name : "";
55 }
56 const NIMQChatFileAttach ToCParam() const {
58 param.file_path = const_cast<char*>(file_path.c_str());
59 param.url = const_cast<char*>(download_url.c_str());
60 param.md5 = const_cast<char*>(hash.c_str());
61 param.ext = const_cast<char*>(extension.c_str());
62 param.name = const_cast<char*>(name.c_str());
63 return param;
64 }
65 void SetRawData(const std::string& raw_data) {
67 if (nim::ParseJsonValue(raw_data, values)) {
68 if (values.isMember(kNIMQChatFilePath))
69 file_path = values[kNIMQChatFilePath].asString();
70 if (values.isMember(kNIMQChatMD5))
71 hash = values[kNIMQChatMD5].asString();
72 if (values.isMember(kNIMQChatName))
73 name = values[kNIMQChatName].asString();
74 if (values.isMember(kNIMQChatURL))
75 download_url = values[kNIMQChatURL].asString();
76 if (values.isMember(kNIMQChatExt))
77 extension = values[kNIMQChatExt].asString();
78 }
79 };
80 std::string GetRawData() const override {
82 ProcessFileFields(values);
83 return nim::GetJsonStringWithNoStyled(values);
84 }
85 void ProcessFileFields(nim_cpp_wrapper_util::Json::Value& values) const {
86 values[kNIMQChatFilePath] = file_path;
87 values[kNIMQChatURL] = download_url;
88 values[kNIMQChatMD5] = hash;
89 values[kNIMQChatExt] = extension;
90 values[kNIMQChatName] = name;
91 }
92 bool IsFileBased() const override { return true; }
93
94 std::string name;
95 std::string file_path;
96 std::string hash;
97 std::string download_url;
98 std::string extension;
99};
100
102struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatImageAttach : public QChatFileAttach {
103 QChatImageAttach() = default;
104 QChatImageAttach(const std::string& raw_data) { SetRawData(raw_data); }
105 QChatImageAttach(const NIMQChatImageAttach& c_param) {
106 file_path = c_param.file_path ? c_param.file_path : "";
107 width = c_param.width;
108 height = c_param.height;
109 download_url = c_param.url ? c_param.url : "";
110 hash = c_param.md5 ? c_param.md5 : "";
111 extension = c_param.ext ? c_param.ext : "";
112 name = c_param.name ? c_param.name : "";
113 }
114 const NIMQChatImageAttach ToCParam() const {
116 param.file_path = const_cast<char*>(file_path.c_str());
117 param.width = width;
118 param.height = height;
119 param.url = const_cast<char*>(download_url.c_str());
120 param.md5 = const_cast<char*>(hash.c_str());
121 param.ext = const_cast<char*>(extension.c_str());
122 param.name = const_cast<char*>(name.c_str());
123 return param;
124 }
125 void SetRawData(const std::string& raw_data) {
126 QChatFileAttach::SetRawData(raw_data);
128 if (nim::ParseJsonValue(raw_data, values)) {
129 if (values.isMember(kNIMQChatWidth))
130 width = values[kNIMQChatWidth].asInt();
131 if (values.isMember(kNIMQChatHeight))
132 height = values[kNIMQChatHeight].asInt();
133 }
134 }
135 std::string GetRawData() const override {
137 ProcessFileFields(values);
138 values[kNIMQChatWidth] = width;
139 values[kNIMQChatHeight] = height;
140 return nim::GetJsonStringWithNoStyled(values);
141 }
142
143 uint32_t width = 0;
144 uint32_t height = 0;
145};
146
148struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAudioAttach : public QChatFileAttach {
149 QChatAudioAttach() = default;
150 QChatAudioAttach(const std::string& raw_data) { SetRawData(raw_data); }
151 QChatAudioAttach(const NIMQChatAudioAttach& c_param) {
152 file_path = c_param.file_path ? c_param.file_path : "";
153 duration = c_param.duration;
154 download_url = c_param.url ? c_param.url : "";
155 hash = c_param.md5 ? c_param.md5 : "";
156 extension = c_param.ext ? c_param.ext : "";
157 name = c_param.name ? c_param.name : "";
158 }
159 const NIMQChatAudioAttach ToCParam() const {
161 param.file_path = const_cast<char*>(file_path.c_str());
162 param.duration = duration;
163 param.url = const_cast<char*>(download_url.c_str());
164 param.md5 = const_cast<char*>(hash.c_str());
165 param.ext = const_cast<char*>(extension.c_str());
166 param.name = const_cast<char*>(name.c_str());
167 return param;
168 }
169 void SetRawData(const std::string& raw_data) {
171 if (nim::ParseJsonValue(raw_data, values)) {
172 if (values.isMember(kNIMQChatDuration))
173 duration = values[kNIMQChatDuration].asInt();
174 }
175 }
176 std::string GetRawData() const override {
178 ProcessFileFields(values);
179 values[kNIMQChatDuration] = duration;
180 return nim::GetJsonStringWithNoStyled(values);
181 }
182
183 uint64_t duration = 0;
184};
185
187struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatVideoAttach : public QChatFileAttach {
188 QChatVideoAttach() = default;
189 QChatVideoAttach(const std::string& raw_data) { SetRawData(raw_data); }
190 QChatVideoAttach(const NIMQChatVideoAttach& c_param) {
191 file_path = c_param.file_path ? c_param.file_path : "";
192 duration = c_param.duration;
193 width = c_param.width;
194 height = c_param.height;
195 download_url = c_param.url ? c_param.url : "";
196 hash = c_param.md5 ? c_param.md5 : "";
197 extension = c_param.ext ? c_param.ext : "";
198 name = c_param.name ? c_param.name : "";
199 }
200 const NIMQChatVideoAttach ToCParam() const {
202 param.file_path = const_cast<char*>(file_path.c_str());
203 param.duration = duration;
204 param.width = width;
205 param.height = height;
206 param.url = const_cast<char*>(download_url.c_str());
207 param.md5 = const_cast<char*>(hash.c_str());
208 param.ext = const_cast<char*>(extension.c_str());
209 param.name = const_cast<char*>(name.c_str());
210 return param;
211 }
212 void SetRawData(const std::string& raw_data) {
214 if (nim::ParseJsonValue(raw_data, values)) {
215 if (values.isMember(kNIMQChatDuration))
216 duration = values[kNIMQChatDuration].asInt();
217 if (values.isMember(kNIMQChatWidth))
218 width = values[kNIMQChatWidth].asInt();
219 if (values.isMember(kNIMQChatHeight))
220 height = values[kNIMQChatHeight].asInt();
221 }
222 }
223 std::string GetRawData() const override {
225 ProcessFileFields(values);
226 values[kNIMQChatDuration] = duration;
227 values[kNIMQChatWidth] = width;
228 values[kNIMQChatHeight] = height;
229 return nim::GetJsonStringWithNoStyled(values);
230 }
231
232 uint64_t duration = 0;
233 uint32_t width = 0;
234 uint32_t height = 0;
235};
236
238struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatLocationAttach : public IQChatAttachInterface {
239 QChatLocationAttach() = default;
240 QChatLocationAttach(const std::string& raw_data) { SetRawData(raw_data); }
242 latitude = c_param.latitude;
243 longitude = c_param.longitude;
244 title = c_param.title ? c_param.title : "";
245 }
246 const NIMQChatLocationAttach ToCParam() const {
248 param.latitude = latitude;
249 param.longitude = longitude;
250 param.title = const_cast<char*>(title.c_str());
251 return param;
252 }
253 void SetRawData(const std::string& raw_data) {
255 if (nim::ParseJsonValue(raw_data, values)) {
256 if (values.isMember(kNIMQChatLatitude))
257 latitude = values[kNIMQChatLatitude].asDouble();
258 if (values.isMember(kNIMQChatLongitude))
259 longitude = values[kNIMQChatLongitude].asDouble();
260 if (values.isMember(kNIMQChatTitle))
261 title = values[kNIMQChatTitle].asString();
262 }
263 }
264 std::string GetRawData() const override {
266 values[kNIMQChatLatitude] = latitude;
267 values[kNIMQChatLongitude] = longitude;
268 values[kNIMQChatTitle] = title;
269 return nim::GetJsonStringWithNoStyled(values);
270 }
271
272 double latitude = 0;
273 double longitude = 0;
274 std::string title;
275};
276
277struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatNotificationAttach : IQChatAttachInterface {
278 QChatNotificationAttach() = default;
279 QChatNotificationAttach(const std::string& raw_data) { SetRawData(raw_data); }
281 id = c_param.id;
282 data = c_param.data ? c_param.data : "";
283 }
284 const NIMQChatNotificationAttach ToCParam() const {
286 param.id = id;
287 param.data = const_cast<char*>(data.c_str());
288 return param;
289 }
290 void SetRawData(const std::string& raw_data) {
292 if (nim::ParseJsonValue(raw_data, values)) {
293 if (values.isMember(kNIMQChatID))
294 id = values[kNIMQChatID].asInt();
295 if (values.isMember(kNIMQChatData))
296 data = values[kNIMQChatData].asString();
297 }
298 }
299 std::string GetRawData() const override {
301 values[kNIMQChatID] = id;
302 values[kNIMQChatData] = data;
303 return nim::GetJsonStringWithNoStyled(values);
304 }
305
306 uint32_t id = 0;
307 std::string data;
308};
309
310struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatTipsAttach : IQChatAttachInterface {
311 QChatTipsAttach() = default;
312 QChatTipsAttach(const std::string& raw_data) { SetRawData(raw_data); }
313 QChatTipsAttach(const NIMQChatTipsAttach& c_param) {
314 type = c_param.type;
315 data = c_param.data ? c_param.data : "";
316 }
317 const NIMQChatTipsAttach ToCParam() const {
318 NIMQChatTipsAttach param;
319 param.type = type;
320 param.data = const_cast<char*>(data.c_str());
321 return param;
322 }
323 void SetRawData(const std::string& raw_data) {
325 if (nim::ParseJsonValue(raw_data, values)) {
326 if (values.isMember(kNIMQChatType))
327 type = values[kNIMQChatType].asInt();
328 if (values.isMember(kNIMQChatData))
329 data = values[kNIMQChatData].asString();
330 }
331 }
332 std::string GetRawData() const override {
334 values[kNIMQChatType] = type;
335 values[kNIMQChatData] = data;
336 return nim::GetJsonStringWithNoStyled(values);
337 }
338
339 uint32_t type = 0;
340 std::string data;
341};
342
344struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageUpdateInfo {
346 std::string postscript;
348 std::string extension;
350 std::string push_content;
352 std::string push_payload;
354 std::string env;
357 // 以下字段仅在收到消息时有效
358 std::string operator_id;
359 uint32_t operator_client_type;
360 QChatMessageUpdateInfo() = default;
362 postscript = c_param.postscript ? c_param.postscript : "";
363 extension = c_param.extension ? c_param.extension : "";
364 push_content = c_param.push_content ? c_param.push_content : "";
365 push_payload = c_param.push_payload ? c_param.push_payload : "";
366 env = c_param.env ? c_param.env : "";
367 route_enable = c_param.route_enable;
368 operator_id = c_param.operator_id ? c_param.operator_id : "";
369 operator_client_type = c_param.operator_client_type;
370 }
371 const NIMQChatMessageUpdateInfo ToCParam() const {
372 NIMQChatMessageUpdateInfo c_param = {};
373 c_param.postscript = const_cast<char*>(postscript.c_str());
374 c_param.extension = const_cast<char*>(extension.c_str());
375 c_param.push_content = const_cast<char*>(push_content.c_str());
376 c_param.push_payload = const_cast<char*>(push_payload.c_str());
377 c_param.env = const_cast<char*>(env.c_str());
378 c_param.route_enable = route_enable;
379 c_param.operator_id = const_cast<char*>(operator_id.c_str());
380 c_param.operator_client_type = operator_client_type;
381 return c_param;
382 }
383};
384
386struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageAntiSpamInfo {
388 bool use_custom_content{false};
390 bool anti_spam_using_yidun{true};
392 std::string anti_spam_content;
401 QChatMessageAntiSpamInfo() = default;
403 use_custom_content = c_param.use_custom_content;
404 anti_spam_using_yidun = c_param.anti_spam_using_yidun;
405 anti_spam_content = c_param.anti_spam_content ? c_param.anti_spam_content : "";
406 anti_spam_bussiness_id = c_param.anti_spam_bussiness_id ? c_param.anti_spam_bussiness_id : "";
407 yidun_callback_url = c_param.yidun_callback_url ? c_param.yidun_callback_url : "";
408 yidun_anti_cheating = c_param.yidun_anti_cheating ? c_param.yidun_anti_cheating : "";
409 yidun_anti_spam_ext = c_param.yidun_anti_spam_ext ? c_param.yidun_anti_spam_ext : "";
410 }
411 const NIMQChatMessageAntiSpamInfo ToCParam() const {
412 NIMQChatMessageAntiSpamInfo c_param = {};
413 c_param.use_custom_content = use_custom_content;
414 c_param.anti_spam_using_yidun = anti_spam_using_yidun;
415 c_param.anti_spam_content = const_cast<char*>(anti_spam_content.c_str());
416 c_param.anti_spam_bussiness_id = const_cast<char*>(anti_spam_bussiness_id.c_str());
417 c_param.yidun_callback_url = const_cast<char*>(yidun_callback_url.c_str());
418 c_param.yidun_anti_cheating = const_cast<char*>(yidun_anti_cheating.c_str());
419 c_param.yidun_anti_spam_ext = const_cast<char*>(yidun_anti_spam_ext.c_str());
420 return c_param;
421 }
422};
423
425struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageThreadInfo {
427 std::string reply_from_accid;
429 uint64_t reply_msg_timestamp = 0;
431 uint64_t reply_msg_server_id = 0;
435 std::string thread_root_accid;
437 uint64_t thread_root_msg_timestamp = 0;
439 uint64_t thread_root_msg_server_id = 0;
442 QChatMessageThreadInfo() = default;
444 reply_from_accid = c_param.reply_from_accid ? c_param.reply_from_accid : "";
445 reply_msg_timestamp = c_param.reply_msg_timestamp;
446 reply_msg_server_id = c_param.reply_msg_server_id;
447 reply_msg_client_id = c_param.reply_msg_client_id ? c_param.reply_msg_client_id : "";
448 thread_root_accid = c_param.thread_root_accid ? c_param.thread_root_accid : "";
449 thread_root_msg_timestamp = c_param.thread_root_msg_timestamp;
450 thread_root_msg_server_id = c_param.thread_root_msg_server_id;
451 thread_root_msg_client_id = c_param.thread_root_msg_client_id ? c_param.thread_root_msg_client_id : "";
452 }
453 const NIMQChatMessageThreadInfo ToCParam() const {
454 NIMQChatMessageThreadInfo c_param = {};
455 c_param.reply_from_accid = const_cast<char*>(reply_from_accid.c_str());
456 c_param.reply_msg_timestamp = reply_msg_timestamp;
457 c_param.reply_msg_server_id = reply_msg_server_id;
458 c_param.reply_msg_client_id = const_cast<char*>(reply_msg_client_id.c_str());
459 c_param.thread_root_accid = const_cast<char*>(thread_root_accid.c_str());
460 c_param.thread_root_msg_timestamp = thread_root_msg_timestamp;
461 c_param.thread_root_msg_server_id = thread_root_msg_server_id;
462 c_param.thread_root_msg_client_id = const_cast<char*>(thread_root_msg_client_id.c_str());
463 return c_param;
464 }
465};
466
468struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageSend {
470 uint64_t server_id{0};
472 uint64_t channel_id{0};
476 uint32_t msg_sub_type{0};
478 std::string msg_body{""};
480 std::shared_ptr<IQChatAttachInterface> msg_attach{std::make_shared<QChatDefaultAttach>()};
482 std::string msg_ext{""};
484 std::string msg_id{""};
486 bool resend_flag{false};
488 bool mention_all{false};
490 std::vector<std::string> mention_accids{};
492 std::vector<uint64_t> mention_role_ids{};
494 bool history_enable{true};
496 std::string push_payload{""};
498 std::string push_content{""};
500 bool push_enable{false};
502 bool need_badge{true};
504 bool need_push_nick{true};
506 bool route_enable{true};
512 std::string env;
513 QChatMessageSend() = default;
514 QChatMessageSend(const NIMQChatMessage& c_param) {
515 server_id = c_param.server_id;
516 channel_id = c_param.channel_id;
517 msg_type = c_param.msg_type;
518 msg_sub_type = c_param.msg_sub_type;
519 msg_body = c_param.msg_body;
520 msg_attach = CreateAttach(c_param);
521 msg_ext = c_param.msg_ext;
522 msg_id = c_param.msg_id ? c_param.msg_id : "";
523 resend_flag = c_param.resend_flag;
524 mention_all = c_param.mention_all;
525 mention_accids.clear();
526 for (auto index = 0; index < c_param.mention_accids_count; ++index) {
527 mention_accids.emplace_back(c_param.mention_accids[index]);
528 }
529 mention_role_ids.clear();
530 for (auto index = 0; index < c_param.mention_role_ids_count; ++index) {
531 mention_role_ids.emplace_back(c_param.mention_role_ids[index]);
532 }
533 history_enable = c_param.history_enable;
534 push_payload = c_param.push_payload;
535 push_content = c_param.push_content;
536 push_enable = c_param.push_enable;
537 need_badge = c_param.need_badge;
538 need_push_nick = c_param.need_push_nick;
539 route_enable = c_param.route_enable;
540 thread_info = c_param.thread_info;
541 anti_spam_info = c_param.anti_spam_info;
542 env = c_param.env ? c_param.env : "";
543 }
544 const NIMQChatMessage ToCParam() const {
545 NIMQChatMessage c_param = {};
546 c_param.server_id = server_id;
547 c_param.channel_id = channel_id;
548 c_param.msg_type = msg_type;
549 c_param.msg_sub_type = msg_sub_type;
550 c_param.msg_body = const_cast<char*>(msg_body.c_str());
551 c_param.msg_ext = const_cast<char*>(msg_ext.c_str());
552 c_param.msg_id = const_cast<char*>(msg_id.c_str());
553 c_param.resend_flag = resend_flag;
554 c_param.mention_all = mention_all;
555 c_param.mention_accids_count = mention_accids.size();
556 c_mention_accids.clear();
557 for (auto& accid : mention_accids) {
558 c_mention_accids.emplace_back(const_cast<char*>(accid.c_str()));
559 }
560 c_param.mention_accids_count = c_mention_accids.size();
561 c_param.mention_accids = const_cast<char**>(c_mention_accids.data());
562 c_param.mention_role_ids_count = mention_role_ids.size();
563 c_param.mention_role_ids = const_cast<uint64_t*>(mention_role_ids.data());
564 c_param.history_enable = history_enable;
565 c_param.push_payload = const_cast<char*>(push_payload.c_str());
566 c_param.push_content = const_cast<char*>(push_content.c_str());
567 c_param.push_enable = push_enable;
568 c_param.need_badge = need_badge;
569 c_param.need_push_nick = need_push_nick;
570 c_param.route_enable = route_enable;
571 c_param.from_accid = nullptr;
572 c_param.from_device_id = nullptr;
573 c_param.from_nick = nullptr;
574 ParseAttach(msg_attach, c_param);
575 c_param.thread_info = thread_info.ToCParam();
576 c_param.anti_spam_info = anti_spam_info.ToCParam();
577 c_param.env = const_cast<char*>(env.c_str());
578 return c_param;
579 }
580 using AttachRawCreateFunc = std::function<std::shared_ptr<IQChatAttachInterface>(const std::string&)>;
581 using AttachCreateFunc = std::function<std::shared_ptr<IQChatAttachInterface>(const NIMQChatMessage&)>;
582 using AttachParseFunc = std::function<void(const std::shared_ptr<IQChatAttachInterface>&, NIMQChatMessage&)>;
583 static std::map<NIMQChatMsgType, AttachRawCreateFunc> attach_raw_create_function_;
584 static std::shared_ptr<IQChatAttachInterface> CreateAttachWithRawData(NIMQChatMsgType type, const std::string& raw_data) {
585 auto iter = attach_raw_create_function_.find(type);
586 if (iter != attach_raw_create_function_.end()) {
587 return iter->second(raw_data);
588 }
589 return std::make_shared<QChatDefaultAttach>(raw_data);
590 }
591
592private:
593 std::shared_ptr<IQChatAttachInterface> CreateAttach(const NIMQChatMessage& m) {
594 auto iter = attach_create_functions_.find(m.msg_type);
595 if (iter != attach_create_functions_.end()) {
596 return iter->second(m);
597 }
598 return std::make_shared<QChatDefaultAttach>(m.default_attach.msg_attach == nullptr ? "" : m.default_attach.msg_attach);
599 }
600 void ParseAttach(const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp) const {
601 if (!p) {
602 return;
603 }
604 auto iter = attach_parse_functions_.find(cp.msg_type);
605 if (iter != attach_parse_functions_.end()) {
606 iter->second(p, cp);
607 } else {
608 cp.default_attach = std::dynamic_pointer_cast<QChatDefaultAttach>(p)->ToCParam();
609 }
610 }
611 template <typename ATTACH_TYPE>
612 static std::shared_ptr<ATTACH_TYPE> GetOriginAttach(const std::shared_ptr<IQChatAttachInterface>& p) {
613 auto attach = std::dynamic_pointer_cast<ATTACH_TYPE>(p);
614 if (attach) {
615 return attach;
616 } else {
617 return std::make_shared<ATTACH_TYPE>(p->GetRawData());
618 }
619 }
620 // clang-format off
621 std::map<NIMQChatMsgType, AttachCreateFunc> attach_create_functions_ = {
622 { kNIMQChatMsgTypeText, [](const NIMQChatMessage& m) { return std::make_shared<QChatDefaultAttach>(m.default_attach); } },
623 { kNIMQChatMsgTypeImage, [](const NIMQChatMessage& m) { return std::make_shared<QChatImageAttach>(m.image_attach); } },
624 { kNIMQChatMsgTypeAudio, [](const NIMQChatMessage& m) { return std::make_shared<QChatAudioAttach>(m.audio_attach); } },
625 { kNIMQChatMsgTypeVideo, [](const NIMQChatMessage& m) { return std::make_shared<QChatVideoAttach>(m.video_attach); } },
626 { kNIMQChatMsgTypeFile, [](const NIMQChatMessage& m) { return std::make_shared<QChatFileAttach>(m.file_attach); } },
627 { kNIMQChatMsgTypeLocation, [](const NIMQChatMessage& m) { return std::make_shared<QChatLocationAttach>(m.location_attach); } },
628 { kNIMQChatMsgTypeNotification, [](const NIMQChatMessage& m) { return std::make_shared<QChatNotificationAttach>(m.notification_attach); } },
629 { kNIMQChatMsgTypeTips, [](const NIMQChatMessage& m) { return std::make_shared<QChatTipsAttach>(m.tips_attach); } }
630 };
631
632 std::map<NIMQChatMsgType, AttachParseFunc> attach_parse_functions_ = {
633 {kNIMQChatMsgTypeText, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
634 { cp.default_attach = GetOriginAttach<QChatDefaultAttach>(p)->ToCParam(); } },
635 {kNIMQChatMsgTypeImage, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
636 { cp.image_attach = GetOriginAttach<QChatImageAttach>(p)->ToCParam(); } },
637 {kNIMQChatMsgTypeAudio, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
638 { cp.audio_attach = GetOriginAttach<QChatAudioAttach>(p)->ToCParam(); } },
639 {kNIMQChatMsgTypeVideo, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
640 { cp.video_attach = GetOriginAttach<QChatVideoAttach>(p)->ToCParam(); } },
641 {kNIMQChatMsgTypeFile, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
642 { cp.file_attach = GetOriginAttach<QChatFileAttach>(p)->ToCParam(); } },
643 {kNIMQChatMsgTypeLocation, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
644 { cp.location_attach = GetOriginAttach<QChatLocationAttach>(p)->ToCParam(); } },
645 {kNIMQChatMsgTypeNotification, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
646 { cp.notification_attach = GetOriginAttach<QChatNotificationAttach>(p)->ToCParam(); } },
647 {kNIMQChatMsgTypeTips, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
648 { cp.tips_attach = GetOriginAttach<QChatTipsAttach>(p)->ToCParam(); } }
649 };
650 // clang-format on
651
652protected:
653 mutable std::vector<char*> c_mention_accids;
654};
655
657struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageUpdateContent {
661 std::string msg_body;
663 std::string msg_ext;
664 QChatMessageUpdateContent() = default;
666 status = c_param.status;
667 msg_body = c_param.msg_body;
668 msg_ext = c_param.msg_ext;
669 }
670 const NIMQChatMessageUpdateContent ToCParam() const {
672 c_param.status = status;
673 c_param.msg_body = const_cast<char*>(msg_body.c_str());
674 c_param.msg_ext = const_cast<char*>(msg_ext.c_str());
675 return c_param;
676 }
677};
678
680struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageUpdateOpeInfo {
682 std::string operator_id;
686 std::string postscript;
688 std::string extension;
690 std::string push_content;
692 std::string push_payload;
693 QChatMessageUpdateOpeInfo() = default;
695 operator_id = c_param.operator_id;
696 operator_client_type = c_param.operator_client_type;
697 postscript = c_param.postscript;
698 extension = c_param.extension;
699 push_content = c_param.push_content;
700 push_payload = c_param.push_payload;
701 }
702 const NIMQChatMessageUpdateOpeInfo ToCParam() const {
704 c_param.operator_id = const_cast<char*>(operator_id.c_str());
705 c_param.operator_client_type = operator_client_type;
706 c_param.postscript = const_cast<char*>(postscript.c_str());
707 c_param.extension = const_cast<char*>(extension.c_str());
708 c_param.push_content = const_cast<char*>(push_content.c_str());
709 c_param.push_payload = const_cast<char*>(push_payload.c_str());
710 return c_param;
711 }
712};
713
715struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessage : public QChatMessageSend {
716 // 以下字段仅在收到消息时有效
720 uint64_t msg_server_id{0};
722 std::string from_accid{""};
724 uint32_t from_client_type{0};
726 std::string from_device_id{""};
728 std::string from_nick{""};
730 uint64_t timestamp{0};
732 uint64_t update_timestamp{0};
736 bool is_anti_spamed{false};
738 std::string anti_spam_result;
740 std::string callback_ext;
745 QChatMessage() = default;
746 QChatMessage(const NIMQChatMessage& c_param)
747 : QChatMessageSend(c_param) {
748 // fill by server
749 status = c_param.status;
750 msg_server_id = c_param.msg_server_id;
751 from_accid = c_param.from_accid ? c_param.from_accid : "";
752 from_client_type = c_param.from_client_type;
753 from_device_id = c_param.from_device_id ? c_param.from_device_id : "";
754 from_nick = c_param.from_nick ? c_param.from_nick : "";
755 timestamp = c_param.timestamp;
756 update_timestamp = c_param.update_timestamp;
757 notify_reason = c_param.notify_reason;
758 is_anti_spamed = c_param.is_anti_spamed;
759 callback_ext = c_param.callback_ext ? c_param.callback_ext : "";
760 anti_spam_result = c_param.anti_spam_result ? c_param.anti_spam_result : "";
761 update_content = c_param.update_content;
762 update_ope_info = c_param.update_ope_info;
763 accids_of_mentioned_roles_available = c_param.accids_of_mentioned_roles_available;
764 accids_of_mentioned_roles.clear();
765 for (auto index = 0; index < c_param.accids_of_mentioned_roles_count; ++index) {
766 accids_of_mentioned_roles.emplace_back(c_param.accids_of_mentioned_roles[index]);
767 }
768 }
769 const NIMQChatMessage ToCParam() const {
770 auto c_param = QChatMessageSend::ToCParam();
771 c_param.status = status;
772 c_param.msg_server_id = msg_server_id;
773 c_param.from_accid = const_cast<char*>(from_accid.c_str());
774 c_param.from_client_type = from_client_type;
775 c_param.from_device_id = const_cast<char*>(from_device_id.c_str());
776 c_param.from_nick = const_cast<char*>(from_nick.c_str());
777 c_param.timestamp = timestamp;
778 c_param.update_timestamp = update_timestamp;
779 c_param.notify_reason = notify_reason;
780 c_param.is_anti_spamed = is_anti_spamed;
781 c_param.callback_ext = const_cast<char*>(callback_ext.c_str());
782 c_param.anti_spam_result = const_cast<char*>(anti_spam_result.c_str());
783 c_param.update_content = update_content.ToCParam();
784 c_param.update_ope_info = update_ope_info.ToCParam();
785 c_param.accids_of_mentioned_roles_available = accids_of_mentioned_roles_available;
786 c_accids_of_mentioned_roles.clear();
787 for (auto& accid : accids_of_mentioned_roles) {
788 c_accids_of_mentioned_roles.emplace_back(const_cast<char*>(accid.c_str()));
789 }
790 c_param.accids_of_mentioned_roles = const_cast<char**>(c_accids_of_mentioned_roles.data());
791 c_param.accids_of_mentioned_roles_count = c_accids_of_mentioned_roles.size();
792 return c_param;
793 }
794 // 内部字段
796 bool accids_of_mentioned_roles_available{false};
798 std::vector<std::string> accids_of_mentioned_roles;
799
800protected:
801 mutable std::vector<char*> c_accids_of_mentioned_roles;
802};
803
805struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRecvMsgResp {
807 QChatMessage message{};
808 QChatRecvMsgResp() = default;
809 QChatRecvMsgResp(const NIMQChatRecvMsgResp& c_resp) { message = c_resp.message; }
810};
811
813struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMsgUpdatedResp {
815 uint32_t res_code{0};
819 QChatMessage message{};
820 QChatMsgUpdatedResp() = default;
822 update_info = c_resp.update_info;
823 message = c_resp.message;
824 }
825};
826
828struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatSendMessageResp {
830 uint32_t res_code{0};
832 QChatMessage message{};
833 QChatSendMessageResp() = default;
835 res_code = c_resp.res_code;
837 return;
838 message = c_resp.message;
839 }
840 const NIMQChatSendMessageResp ToCParam() const {
841 NIMQChatSendMessageResp c_response;
842 c_response.message = message.ToCParam();
843 c_response.res_code = res_code;
844 return c_response;
845 }
846};
847
849using QChatReplyMessageResp = QChatSendMessageResp;
850
852struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateMessageResp {
854 uint32_t res_code{0};
856 QChatMessage message{};
857 QChatUpdateMessageResp() = default;
859 res_code = c_resp.res_code;
861 return;
862 message = c_resp.message;
863 }
864 const NIMQChatUpdateMessageResp ToCParam() const {
865 NIMQChatUpdateMessageResp c_response;
866 c_response.message = message.ToCParam();
867 c_response.res_code = res_code;
868 return c_response;
869 }
870};
871
873struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMessagesResp {
875 uint32_t res_code{0};
877 std::list<QChatMessage> messages{};
878 QChatGetMessagesResp() = default;
880 res_code = c_resp.res_code;
881 if (c_resp.res_code != kNIMResSuccess)
882 return;
883 for (size_t i = 0; i < c_resp.messages_count; i++) {
884 messages.emplace_back(c_resp.messages[i]);
885 }
886 }
887 const NIMQChatGetMessagesResp ToCParam() const {
888 NIMQChatGetMessagesResp c_response;
889 c_response.res_code = res_code;
890 message_.clear();
891 for (const auto& msg : messages) {
892 message_.push_back(msg.ToCParam());
893 }
894 c_response.messages = const_cast<NIMQChatMessage*>(message_.data());
895 c_response.messages_count = static_cast<uint32_t>(message_.size());
896 return c_response;
897 }
898
899private:
900 mutable std::vector<NIMQChatMessage> message_;
901};
902
904struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetLastMessagesResp {
906 uint32_t res_code{0};
908 std::map<uint64_t, QChatMessage> messages{};
909 QChatGetLastMessagesResp() = default;
911 res_code = c_resp.res_code;
912 if (c_resp.res_code != kNIMResSuccess)
913 return;
914 for (size_t i = 0; i < c_resp.messages_count; i++) {
915 messages.emplace(c_resp.messages[i].channel_id, c_resp.messages[i]);
916 }
917 }
918 const NIMQChatGetLastMessagesResp ToCParam() const {
920 c_response.res_code = res_code;
921 message_.clear();
922 for (auto&& iter : messages) {
923 message_.push_back(iter.second.ToCParam());
924 }
925 c_response.messages = const_cast<NIMQChatMessage*>(message_.data());
926 c_response.messages_count = static_cast<uint32_t>(message_.size());
927 return c_response;
928 }
929
930private:
931 mutable std::vector<NIMQChatMessage> message_;
932};
933
935using QChatGetMessagesCacheResp = QChatGetMessagesResp;
936
938using QChatGetMessageHistoryByIdsResp = QChatGetMessagesResp;
939
941using QChatGetReferMessagesResp = QChatGetMessagesResp;
942
944struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMarkMessageReadResp {
946 uint32_t res_code = 0;
948 NIMQChatUnreadInfo unread_info{};
949 QChatMarkMessageReadResp() = default;
951 res_code = c_resp.res_code;
952 unread_info = c_resp.unread_info;
953 }
954 const NIMQChatMarkMessageReadResp ToCParam() const {
955 NIMQChatMarkMessageReadResp c_response{};
956 c_response.res_code = res_code;
957 c_response.unread_info = unread_info;
958 return c_response;
959 }
960};
961
963struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetThreadMessagesResp {
965 uint32_t res_code{0};
971 std::list<QChatMessage> messages;
972 QChatGetThreadMessagesResp() = default;
974 res_code = c_resp.res_code;
975 if (c_resp.res_code != kNIMResSuccess)
976 return;
977 meta_info = c_resp.meta_info;
978 root_message = c_resp.root_message;
979 for (size_t i = 0; i < c_resp.messages_count; i++) {
980 messages.emplace_back(c_resp.messages[i]);
981 }
982 }
983 const NIMQChatGetThreadMessagesResp ToCParam() const {
985 c_response.meta_info = meta_info;
986 c_response.meta_info.thread_msg_server_id = root_message.msg_server_id;
987 c_response.meta_info.thread_msg_timestamp = root_message.timestamp;
988 c_response.root_message = root_message.ToCParam();
989 messages_.clear();
990 for (auto& message : messages)
991 messages_.push_back(message.ToCParam());
992 c_response.messages = const_cast<NIMQChatMessage*>(messages_.data());
993 c_response.messages_count = messages_.size();
994 c_response.res_code = res_code;
995 return c_response;
996 }
997
998private:
999 mutable std::vector<NIMQChatMessage> messages_;
1000};
1001
1003struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetThreadRootMessagesMetaResp {
1005 uint32_t res_code = 0;
1007 std::vector<NIMQChatThreadMessageMetaInfo> meta_infos;
1010 res_code = c_resp.res_code;
1011 if (c_resp.res_code != kNIMResSuccess)
1012 return;
1013 for (size_t i = 0; i < c_resp.meta_info_count; i++) {
1014 meta_infos.emplace_back(c_resp.meta_infos[i]);
1015 }
1016 }
1017 const NIMQChatGetThreadRootMessagesMetaResp ToCParam() const {
1019 c_response.res_code = res_code;
1020 c_response.meta_infos = const_cast<NIMQChatThreadMessageMetaInfo*>(meta_infos.data());
1021 c_response.meta_info_count = meta_infos.size();
1022 return c_response;
1023 }
1024};
1025
1027using QChatAddQuickCommentResp = QChatBaseResp;
1028
1030using QChatRemoveQuickCommentResp = QChatBaseResp;
1031
1033struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatQuickCommentDetail {
1035 uint64_t type;
1037 uint64_t count;
1041 std::list<std::string> accids;
1042 QChatQuickCommentDetail() = default;
1044 type = c_param.type;
1045 count = c_param.count;
1046 include_yourself = c_param.include_yourself;
1047 for (size_t i = 0; i < c_param.account_count; i++) {
1048 accids.emplace_back(c_param.accids[i]);
1049 }
1050 }
1051 const NIMQChatQuickCommentDetail ToCParam() const {
1053 detail.type = type;
1054 detail.count = count;
1055 detail.include_yourself = include_yourself;
1056 accids_.clear();
1057 for (auto& account : accids)
1058 accids_.push_back(const_cast<char*>(account.c_str()));
1059 detail.accids = const_cast<char**>(accids_.data());
1060 detail.account_count = accids_.size();
1061 return detail;
1062 }
1063
1064private:
1065 mutable std::vector<char*> accids_;
1066};
1067
1069struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatQuickCommentInfo {
1071 uint64_t server_id;
1073 uint64_t channel_id;
1077 uint64_t count;
1079 uint64_t timestamp;
1081 std::list<QChatQuickCommentDetail> details;
1082 QChatQuickCommentInfo() = default;
1084 server_id = c_param.server_id;
1085 channel_id = c_param.channel_id;
1086 msg_server_id = c_param.msg_server_id;
1087 count = c_param.count;
1088 timestamp = c_param.timestamp;
1089 for (size_t i = 0; i < c_param.detail_count; i++) {
1090 details.emplace_back(c_param.detail[i]);
1091 }
1092 }
1093 const NIMQChatQuickCommentInfo ToCParam() const {
1095 info.server_id = server_id;
1096 info.channel_id = channel_id;
1097 info.msg_server_id = msg_server_id;
1098 info.count = count;
1099 info.timestamp = timestamp;
1100 detail_.clear();
1101 for (auto& d : details)
1102 detail_.push_back(d.ToCParam());
1103 info.detail = const_cast<NIMQChatQuickCommentDetail*>(detail_.data());
1104 info.detail_count = detail_.size();
1105 return info;
1106 }
1107
1108private:
1109 mutable std::vector<NIMQChatQuickCommentDetail> detail_;
1110};
1111
1113struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetQuickCommentsResp {
1115 uint32_t res_code{0};
1117 std::list<QChatQuickCommentInfo> comments{};
1118 QChatGetQuickCommentsResp() = default;
1120 res_code = c_response.res_code;
1121 if (c_response.res_code != kNIMResSuccess)
1122 return;
1123 for (size_t i = 0; i < c_response.comments_count; i++) {
1124 comments.emplace_back(c_response.comments[i]);
1125 }
1126 }
1127 const NIMQChatGetQuickCommentsResp ToCParam() const {
1129 c_response.res_code = res_code;
1130 if (res_code != kNIMResSuccess)
1131 return c_response;
1132 comments_.clear();
1133 for (auto& comment : comments)
1134 comments_.push_back(comment.ToCParam());
1135 c_response.comments = const_cast<NIMQChatQuickCommentInfo*>(comments_.data());
1136 c_response.comments_count = comments_.size();
1137 return c_response;
1138 }
1139
1140private:
1141 mutable std::vector<NIMQChatQuickCommentInfo> comments_;
1142};
1143
1147 uint32_t res_code{0};
1151 std::vector<QChatMessage> messages{};
1152 QChatMessageSearchPageResp() = default;
1154 res_code = c_response.res_code;
1155 page_info = c_response.page_info;
1156 for (size_t i = 0; i < c_response.messages_count; i++) {
1157 messages.emplace_back(c_response.messages[i]);
1158 }
1159 }
1160 const NIMQChatMessageSearchPageResp ToCParam() const {
1162 c_response.res_code = res_code;
1163 c_response.page_info = page_info.ToCParam();
1164 c_messages.clear();
1165 for (auto& message : messages)
1166 c_messages.push_back(message.ToCParam());
1167 c_response.messages = const_cast<NIMQChatMessage*>(c_messages.data());
1168 c_response.messages_count = c_messages.size();
1169 return c_response;
1170 }
1171
1172protected:
1173 mutable std::vector<NIMQChatMessage> c_messages;
1174};
1175
1177typedef std::function<void(const QChatRecvMsgResp&)> RecvMsgCallback;
1179typedef std::function<void(const QChatSendMessageResp&)> SendMsgCallback;
1181typedef std::function<void(const QChatUpdateMessageResp&)> UpdateMsgCallback;
1183typedef std::function<void(const QChatMsgUpdatedResp&)> MsgUpdatedCallback;
1185typedef std::function<void(const QChatGetMessagesResp&)> GetMessagesCallback;
1187typedef std::function<void(const QChatGetLastMessagesResp&)> GetLastMessagesCallback;
1191typedef std::function<void(const QChatMarkMessageReadResp&)> MarkMessageReadCallback;
1193using ReplyMessageCallback = std::function<void(const QChatReplyMessageResp&)>;
1199using GetThreadMessagesCallback = std::function<void(const QChatGetThreadMessagesResp&)>;
1205using GetQuickCommentsCallback = std::function<void(const QChatGetQuickCommentsResp&)>;
1207using MessageSearchPageCallback = std::function<void(const QChatMessageSearchPageResp&)>;
1208
1210struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRegRecvMsgCbParam {
1212 RecvMsgCallback cb{nullptr};
1213 const NIMQChatRegRecvMsgCbParam ToCParam() const {
1214 static RecvMsgCallback cb_holder = nullptr;
1215 cb_holder = cb;
1216 NIMQChatRegRecvMsgCbParam param = {};
1217 param.cb = [](const NIMQChatRecvMsgResp& resp) {
1218 if (cb_holder)
1219 cb_holder(resp);
1220 };
1221 return param;
1222 }
1223};
1224
1226struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRegMsgUpdatedCbParam {
1229 const NIMQChatRegMsgUpdatedCbParam ToCParam() const {
1230 static MsgUpdatedCallback cb_holder = nullptr;
1231 cb_holder = cb;
1233 param.cb = [](const NIMQChatMsgUpdatedResp& resp) {
1234 if (cb_holder)
1235 cb_holder(resp);
1236 };
1237 return param;
1238 }
1239};
1240
1242struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatSendMessageParam {
1244 SendMsgCallback cb{nullptr};
1247 QChatSendMessageParam() = default;
1249 message = c_param.message;
1250 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatSendMessageResp& response) {
1251 auto c_response = response.ToCParam();
1252 c_response.user_data = user_data;
1253 c_callback(c_response);
1254 };
1255 }
1256 const NIMQChatSendMessageParam ToCParam() const {
1257 auto cb_holder = new SendMsgCallback(cb);
1258 NIMQChatSendMessageParam param = {};
1259 param.user_data = cb_holder;
1260 param.cb = [](const NIMQChatSendMessageResp& resp) {
1261 InvokeCallback<SendMsgCallback, NIMQChatSendMessageResp>(resp);
1262 };
1263 param.message = message.ToCParam();
1264 return param;
1265 }
1266};
1267
1269struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateMessageParam {
1275 uint64_t msg_server_id{0};
1277 uint64_t timestamp{0};
1282 // 以下为待更新的消息属性
1286 std::string msg_body{""};
1288 std::string msg_ext{""};
1290 uint32_t msg_sub_type{0};
1291 QChatUpdateMessageParam() = default;
1293 id_info = c_param.id_info;
1294 msg_server_id = c_param.msg_server_id;
1295 timestamp = c_param.timestamp;
1296 update_info = c_param.update_info;
1297 anti_spam_info = c_param.anti_spam_info;
1298 status = c_param.status;
1299 msg_body = c_param.msg_body;
1300 msg_ext = c_param.msg_ext;
1301 msg_sub_type = c_param.msg_sub_type;
1302 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatUpdateMessageResp& response) {
1303 auto c_response = response.ToCParam();
1304 c_response.user_data = user_data;
1305 c_callback(c_response);
1306 };
1307 }
1308 QChatUpdateMessageParam(const NIMQChatRevokeMessageParam& c_param) {
1309 id_info = c_param.id_info;
1310 msg_server_id = c_param.msg_server_id;
1311 timestamp = c_param.timestamp;
1312 update_info = c_param.update_info;
1313 status = kMsgStatusRevoke;
1314 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatUpdateMessageResp& response) {
1315 auto c_response = response.ToCParam();
1316 c_response.user_data = user_data;
1317 c_callback(c_response);
1318 };
1319 }
1320 QChatUpdateMessageParam(const NIMQChatDeleteMessageParam& c_param) {
1321 id_info = c_param.id_info;
1322 msg_server_id = c_param.msg_server_id;
1323 timestamp = c_param.timestamp;
1324 update_info = c_param.update_info;
1325 status = kMsgStatusDelete;
1326 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatUpdateMessageResp& response) {
1327 auto c_response = response.ToCParam();
1328 c_response.user_data = user_data;
1329 c_callback(c_response);
1330 };
1331 }
1332 const NIMQChatUpdateMessageParam ToCParam() const {
1333 auto cb_holder = new UpdateMsgCallback(cb);
1334 NIMQChatUpdateMessageParam param = {};
1335 param.user_data = cb_holder;
1336 param.cb = [](const NIMQChatUpdateMessageResp& resp) {
1337 InvokeCallback<UpdateMsgCallback, NIMQChatUpdateMessageResp>(resp);
1338 };
1339 param.id_info = id_info;
1340 param.msg_server_id = msg_server_id;
1341 param.timestamp = timestamp;
1342 param.update_info = update_info.ToCParam();
1343 param.anti_spam_info = anti_spam_info.ToCParam();
1344 param.status = status;
1345 param.msg_body = const_cast<char*>(msg_body.c_str());
1346 param.msg_ext = const_cast<char*>(msg_ext.c_str());
1347 param.msg_sub_type = msg_sub_type;
1348 return param;
1349 }
1350};
1351
1353struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRevokeMessageParam {
1356 NIMQChatChannelIDInfo id_info{};
1357 uint64_t msg_server_id{0};
1358 uint64_t timestamp{0};
1359 QChatMessageUpdateInfo update_info{};
1360 const NIMQChatRevokeMessageParam ToCParam() const {
1361 auto cb_holder = new UpdateMsgCallback(cb);
1362 NIMQChatRevokeMessageParam param = {};
1363 param.user_data = cb_holder;
1364 param.cb = [](const NIMQChatUpdateMessageResp& resp) {
1365 InvokeCallback<UpdateMsgCallback, NIMQChatUpdateMessageResp>(resp);
1366 };
1367 param.id_info = id_info;
1368 param.msg_server_id = msg_server_id;
1369 param.timestamp = timestamp;
1370 param.update_info = update_info.ToCParam();
1371 return param;
1372 }
1373};
1374
1376struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatDeleteMessageParam {
1379 NIMQChatChannelIDInfo id_info{};
1380 uint64_t msg_server_id{0};
1381 uint64_t timestamp{0};
1382 QChatMessageUpdateInfo update_info{};
1383 const NIMQChatDeleteMessageParam ToCParam() const {
1384 auto cb_holder = new UpdateMsgCallback(cb);
1385 NIMQChatDeleteMessageParam param = {};
1386 param.user_data = cb_holder;
1387 param.cb = [](const NIMQChatUpdateMessageResp& resp) {
1388 InvokeCallback<UpdateMsgCallback, NIMQChatUpdateMessageResp>(resp);
1389 };
1390 param.id_info = id_info;
1391 param.msg_server_id = msg_server_id;
1392 param.timestamp = timestamp;
1393 param.update_info = update_info.ToCParam();
1394 return param;
1395 }
1396};
1397
1399struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMessagesParam {
1403 uint64_t server_id{0};
1405 uint64_t channel_id{0};
1407 uint64_t from_time{0};
1409 uint64_t to_time{0};
1411 uint64_t exclude_msg_server_id{0};
1413 uint32_t limit{100};
1415 bool reverse{false};
1416 QChatGetMessagesParam() = default;
1418 server_id = c_param.server_id;
1419 channel_id = c_param.channel_id;
1420 from_time = c_param.from_time;
1421 to_time = c_param.to_time;
1422 exclude_msg_server_id = c_param.exclude_msg_server_id;
1423 limit = c_param.limit;
1424 reverse = c_param.reverse;
1425 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetMessagesResp& response) {
1426 auto c_response = response.ToCParam();
1427 c_response.user_data = user_data;
1428 c_callback(c_response);
1429 };
1430 }
1431 const NIMQChatGetMessagesParam ToCParam() const {
1432 auto cb_holder = new GetMessagesCallback(cb);
1433 NIMQChatGetMessagesParam param = {};
1434 param.user_data = cb_holder;
1435 param.cb = [](const NIMQChatGetMessagesResp& resp) {
1436 InvokeCallback<GetMessagesCallback, NIMQChatGetMessagesResp>(resp);
1437 };
1438 param.server_id = server_id;
1439 param.channel_id = channel_id;
1440 param.from_time = from_time;
1441 param.to_time = to_time;
1442 param.exclude_msg_server_id = exclude_msg_server_id;
1443 param.limit = limit;
1444 param.reverse = reverse;
1445 return param;
1446 }
1447};
1448
1450struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetLastMessagesParam {
1454 uint64_t server_id{0};
1456 std::vector<uint64_t> channel_ids{};
1457 QChatGetLastMessagesParam() = default;
1459 server_id = c_param.server_id;
1460 for (size_t i = 0; i < c_param.channel_ids_count; i++) {
1461 channel_ids.emplace_back(c_param.channel_ids[i]);
1462 }
1463 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetLastMessagesResp& response) {
1464 auto c_response = response.ToCParam();
1465 c_response.user_data = user_data;
1466 c_callback(c_response);
1467 };
1468 }
1469 const NIMQChatGetLastMessagesParam ToCParam() const {
1470 auto cb_holder = new GetLastMessagesCallback(cb);
1472 param.user_data = cb_holder;
1473 param.cb = [](const NIMQChatGetLastMessagesResp& resp) {
1474 InvokeCallback<GetLastMessagesCallback, NIMQChatGetLastMessagesResp>(resp);
1475 };
1476 param.server_id = server_id;
1477 param.channel_ids_count = channel_ids.size();
1478 param.channel_ids = const_cast<uint64_t*>(channel_ids.data());
1479 return param;
1480 }
1481};
1482
1484struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMessagesCacheParam {
1488 uint64_t server_id;
1490 uint64_t channel_id;
1491 QChatGetMessagesCacheParam() = default;
1492 const NIMQChatGetMessagesCacheParam ToCParam() const {
1493 auto cb_holder = new GetMessagesCacheCallback(cb);
1495 param.user_data = cb_holder;
1496 param.cb = [](const NIMQChatGetMessagesCacheResp& resp) {
1497 InvokeCallback<GetMessagesCacheCallback, NIMQChatGetMessagesCacheResp>(resp);
1498 };
1499 param.server_id = server_id;
1500 param.channel_id = channel_id;
1501 return param;
1502 }
1503};
1504
1506struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMarkMessageReadParam {
1512 uint64_t timestamp{0};
1513 QChatMarkMessageReadParam() = default;
1515 id_info = param.id_info;
1516 timestamp = param.timestamp;
1517 cb = [c_callback = param.cb, user_data = param.user_data](const QChatMarkMessageReadResp& response) {
1518 auto c_response = response.ToCParam();
1519 c_response.user_data = user_data;
1520 c_callback(c_response);
1521 };
1522 }
1523 const NIMQChatMarkMessageReadParam ToCParam() const {
1524 auto cb_holder = new MarkMessageReadCallback(cb);
1526 param.user_data = cb_holder;
1527 param.cb = [](const NIMQChatMarkMessageReadResp& resp) {
1528 InvokeCallback<MarkMessageReadCallback, NIMQChatMarkMessageReadResp>(resp);
1529 };
1530 param.id_info = id_info;
1531 param.timestamp = timestamp;
1532 return param;
1533 }
1534};
1535
1537struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatReplyMessageParam {
1544 QChatReplyMessageParam() = default;
1546 quote_message = c_param.quote_message;
1547 message = c_param.message;
1548 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatReplyMessageResp& response) {
1549 auto c_response = response.ToCParam();
1550 c_response.user_data = user_data;
1551 c_callback(&c_response);
1552 };
1553 }
1554 const NIMQChatReplyMessageParam ToCParam() const {
1555 auto cb_holder = new ReplyMessageCallback(cb);
1556 NIMQChatReplyMessageParam param = {};
1557 param.quote_message = quote_message.ToCParam();
1558 param.message = message.ToCParam();
1559 param.user_data = cb_holder;
1560 param.cb = [](const NIMQChatReplyMsgResp* c_response) {
1561 InvokeCallback<ReplyMessageCallback, NIMQChatReplyMsgResp>(*c_response);
1562 };
1563 return param;
1564 }
1565};
1566
1568struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMessageHistoryByIdsParam {
1569 GetMessageHistoryByIdsCallback cb = nullptr;
1570 uint64_t server_id = 0;
1571 uint64_t channel_id = 0;
1572 std::vector<NIMQChatGetMessageColumns> columns;
1575 server_id = c_param.server_id;
1576 channel_id = c_param.channel_id;
1577 for (size_t i = 0; i < c_param.column_count; i++) {
1578 columns.push_back(c_param.columns[i]);
1579 }
1580 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetMessageHistoryByIdsResp& response) {
1581 auto c_response = response.ToCParam();
1582 c_response.user_data = user_data;
1583 c_callback(&c_response);
1584 };
1585 }
1586 const NIMQChatGetMessageHistoryByIdsParam ToCParam() const {
1587 auto cb_holder = new GetMessageHistoryByIdsCallback(cb);
1589 param.server_id = server_id;
1590 param.channel_id = channel_id;
1591 param.columns = const_cast<NIMQChatGetMessageColumns*>(columns.data());
1592 param.column_count = columns.size();
1593 param.user_data = cb_holder;
1594 param.cb = [](const NIMQChatGetMessageHistoryByIdsResp* c_response) {
1595 InvokeCallback<GetMessageHistoryByIdsCallback, NIMQChatGetMessageHistoryByIdsResp>(*c_response);
1596 };
1597 return param;
1598 }
1599};
1600
1602struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetReferMessagesParam {
1605 QChatMessage message;
1606 QChatGetReferMessagesParam() = default;
1608 type = c_param.type;
1609 message = c_param.message;
1610 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetReferMessagesResp& response) {
1611 auto c_response = response.ToCParam();
1612 c_response.user_data = user_data;
1613 c_callback(&c_response);
1614 };
1615 }
1616 const NIMQChatGetReferMessagesParam ToCParam() const {
1618 param.type = type;
1619 param.message = message.ToCParam();
1620 param.user_data = new GetReferMessagesCallback(cb);
1621 param.cb = [](const NIMQChatGetReferMessagesResp* c_response) {
1622 InvokeCallback<GetReferMessagesCallback, NIMQChatGetReferMessagesResp>(*c_response);
1623 };
1624 return param;
1625 }
1626};
1627
1629struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetThreadMessagesParam {
1635 uint64_t from_time = 0;
1637 uint64_t to_time = 0;
1639 uint64_t exclude_msg_server_id = 0;
1641 uint32_t limit = 10;
1643 bool reverse = false;
1644 QChatGetThreadMessagesParam() = default;
1646 message = c_param.message;
1647 from_time = c_param.from_time;
1648 to_time = c_param.to_time;
1649 exclude_msg_server_id = c_param.exclude_msg_server_id;
1650 limit = c_param.limit;
1651 reverse = c_param.reverse;
1652 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetThreadMessagesResp& response) {
1653 auto c_response = response.ToCParam();
1654 c_response.user_data = user_data;
1655 c_callback(&c_response);
1656 };
1657 }
1658 const NIMQChatGetThreadMessagesParam ToCParam() const {
1659 auto cb_holder = new GetThreadMessagesCallback(cb);
1661 param.message = message.ToCParam();
1662 param.from_time = from_time;
1663 param.to_time = to_time;
1664 param.exclude_msg_server_id = exclude_msg_server_id;
1665 param.limit = limit;
1666 param.reverse = reverse;
1667 param.user_data = cb_holder;
1668 param.cb = [](const NIMQChatGetThreadMessagesResp* c_response) {
1669 InvokeCallback<GetThreadMessagesCallback, NIMQChatGetThreadMessagesResp>(*c_response);
1670 };
1671 return param;
1672 }
1673};
1674
1675template <NIMQChatQuickCommentOperation operation, typename TCParam, typename TCResponse>
1676struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatQuickCommentParam {
1682 uint32_t type;
1683 QChatQuickCommentParam() = default;
1684 QChatQuickCommentParam(const TCParam& c_param) {
1685 message = c_param.quote_message;
1686 type = c_param.type;
1687 opt = c_param.operation;
1688 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatAddQuickCommentResp& response) {
1689 auto c_response = response.ToCParam();
1690 c_response.user_data = user_data;
1691 c_callback(&c_response);
1692 };
1693 }
1694 const TCParam ToCParam() const {
1695 auto cb_holder = new QuickCommentCallback(cb);
1696 TCParam param;
1697 param.quote_message = message.ToCParam();
1698 param.type = type;
1699 param.operation = opt;
1700 param.user_data = cb_holder;
1701 param.cb = [](const TCResponse* c_response) {
1702 InvokeCallback<QuickCommentCallback, TCResponse>(*c_response);
1703 };
1704 return param;
1705 }
1706 NIMQChatQuickCommentOperation GetOperation() const { return opt; }
1707
1708private:
1710 NIMQChatQuickCommentOperation opt = operation;
1711};
1712
1714struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetThreadRootMessagesMetaParam {
1717 uint64_t server_id = 0;
1718 uint64_t channel_id = 0;
1719 std::list<QChatMessage> thread_root_messages;
1722 server_id = c_param.server_id;
1723 channel_id = c_param.channel_id;
1724 for (size_t i = 0; i < c_param.message_count; i++) {
1725 thread_root_messages.push_back(c_param.messages[i]);
1726 }
1727 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetThreadRootMessagesMetaResp& response) {
1728 auto c_response = response.ToCParam();
1729 c_response.user_data = user_data;
1730 c_callback(&c_response);
1731 };
1732 }
1733 const NIMQChatGetThreadRootMessagesMetaParam ToCParam() const {
1735 param.server_id = server_id;
1736 param.channel_id = channel_id;
1737 messages_.clear();
1738 for (auto& message : thread_root_messages) {
1739 messages_.push_back(message.ToCParam());
1740 }
1741 param.messages = const_cast<NIMQChatMessage*>(messages_.data());
1742 param.message_count = messages_.size();
1744 param.cb = [](const NIMQChatGetThreadRootMessagesMetaResp* c_response) {
1745 InvokeCallback<GetThreadRootMessagesMetaCallback, NIMQChatGetThreadRootMessagesMetaResp>(*c_response);
1746 };
1747 return param;
1748 }
1749
1750private:
1751 mutable std::vector<NIMQChatMessage> messages_;
1752};
1753
1754// clang-format off
1755using QChatAddQuickCommentParam = QChatQuickCommentParam<kNIMQChatQuickCommentAdd, NIMQChatAddQuickCommentParam, NIMQChatAddQuickCommentResp>;
1756using QChatRemoveQuickCommentParam = QChatQuickCommentParam<kNIMQChatQuickCommentRemove, NIMQChatRemoveQuickCommentParam, NIMQChatRemoveQuickCommentResp>;
1757// clang-format on
1758
1760struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetQuickCommentsParam {
1764 uint64_t server_id;
1766 uint64_t channel_id;
1768 std::vector<uint64_t> msg_server_id_list;
1769 QChatGetQuickCommentsParam() = default;
1771 server_id = c_param.server_id;
1772 channel_id = c_param.channel_id;
1773 for (size_t i = 0; i < c_param.msg_server_id_count; i++)
1774 msg_server_id_list.push_back(c_param.msg_server_id_list[i]);
1775 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatGetQuickCommentsResp& response) {
1776 auto c_response = response.ToCParam();
1777 c_response.user_data = user_data;
1778 c_callback(&c_response);
1779 };
1780 }
1781 const NIMQChatGetQuickCommentsParam ToCParam() const {
1782 auto cb_holder = new GetQuickCommentsCallback(cb);
1784 param.server_id = server_id;
1785 param.channel_id = channel_id;
1786 param.msg_server_id_list = const_cast<uint64_t*>(msg_server_id_list.data());
1787 param.msg_server_id_count = msg_server_id_list.size();
1788 param.user_data = cb_holder;
1789 param.cb = [](const NIMQChatGetQuickCommentsResp* resp) {
1790 InvokeCallback<GetQuickCommentsCallback, NIMQChatGetQuickCommentsResp>(*resp);
1791 };
1792 param.server_id = server_id;
1793 param.channel_id = channel_id;
1794 return param;
1795 }
1796};
1797
1799struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMessageSearchPageParam {
1803 std::string keyword;
1805 uint64_t server_id;
1807 uint64_t channel_id;
1809 std::string from_accid;
1811 uint64_t from_time;
1813 uint64_t to_time;
1815 std::vector<NIMQChatMsgType> msg_types;
1817 std::vector<uint32_t> sub_types;
1819 bool include_self{false};
1825 uint32_t limit;
1827 std::string cursor;
1828 QChatMessageSearchPageParam() = default;
1830 keyword = c_param.keyword ? c_param.keyword : "";
1831 server_id = c_param.server_id;
1832 channel_id = c_param.channel_id;
1833 from_accid = c_param.from_accid ? c_param.from_accid : "";
1834 from_time = c_param.from_time;
1835 to_time = c_param.to_time;
1836 for (size_t i = 0; i < c_param.msg_types_count; i++)
1837 msg_types.push_back(c_param.msg_types[i]);
1838 for (size_t i = 0; i < c_param.sub_types_count; i++)
1839 sub_types.push_back(c_param.sub_types[i]);
1840 include_self = c_param.include_self;
1841 order = c_param.order;
1842 sort = c_param.sort;
1843 limit = c_param.limit;
1844 cursor = c_param.cursor ? c_param.cursor : "";
1845 cb = [c_callback = c_param.cb, user_data = c_param.user_data](const QChatMessageSearchPageResp& response) {
1846 auto c_response = response.ToCParam();
1847 c_response.user_data = user_data;
1848 c_callback(&c_response);
1849 };
1850 }
1851 const NIMQChatMessageSearchPageParam ToCParam() const {
1853 param.keyword = const_cast<char*>(keyword.c_str());
1854 param.server_id = server_id;
1855 param.channel_id = channel_id;
1856 param.from_accid = const_cast<char*>(from_accid.c_str());
1857 param.from_time = from_time;
1858 param.to_time = to_time;
1859 param.msg_types = const_cast<NIMQChatMsgType*>(msg_types.data());
1860 param.msg_types_count = msg_types.size();
1861 param.sub_types = const_cast<uint32_t*>(sub_types.data());
1862 param.sub_types_count = sub_types.size();
1863 param.include_self = include_self;
1864 param.order = order;
1865 param.sort = sort;
1866 param.limit = limit;
1867 param.cursor = const_cast<char*>(cursor.c_str());
1868 param.user_data = new MessageSearchPageCallback(cb);
1869 param.cb = [](const NIMQChatMessageSearchPageResp* c_response) {
1870 InvokeCallback<MessageSearchPageCallback, NIMQChatMessageSearchPageResp>(*c_response);
1871 };
1872 return param;
1873 }
1874};
1875} // namespace nim_qchat
1876
1877#endif // __NIM_QCHAT_MESSAGE_CPP_DEF_H__
Represents a JSON value.
Definition: value.h:196
bool isMember(const char *key) const
Definition: json_value.cpp:1241
String asString() const
Embedded zeroes are possible.
Definition: json_value.cpp:632
namespace nim_qchat
std::function< void(const QChatGetLastMessagesResp &)> GetLastMessagesCallback
查询频道最后一条消息回调
Definition: nim_qchat_message_cpp_def.h:1187
std::function< void(const QChatGetMessagesResp &)> GetMessagesCallback
查询历史消息回调
Definition: nim_qchat_message_cpp_def.h:1185
std::function< void(const QChatSendMessageResp &)> SendMsgCallback
发送消息回调
Definition: nim_qchat_message_cpp_def.h:1179
std::function< void(const QChatMarkMessageReadResp &)> MarkMessageReadCallback
消息已读标记回调
Definition: nim_qchat_message_cpp_def.h:1191
std::function< void(const QChatBaseResp &)> QChatBaseCallback
通用回调模板
Definition: nim_qchat_public_cpp_def.h:95
GetMessagesCallback GetMessagesCacheCallback
本地获取消息回调
Definition: nim_qchat_message_cpp_def.h:1189
GetMessagesCallback GetMessageHistoryByIdsCallback
根据消息 ID 查询消息回调
Definition: nim_qchat_message_cpp_def.h:1195
std::function< void(const QChatMsgUpdatedResp &)> MsgUpdatedCallback
消息更新回调
Definition: nim_qchat_message_cpp_def.h:1183
QChatBaseCallback QuickCommentCallback
添加快捷回复回调
Definition: nim_qchat_message_cpp_def.h:1203
std::function< void(const QChatGetThreadRootMessagesMetaResp &)> GetThreadRootMessagesMetaCallback
查询Thread消息元信息回调
Definition: nim_qchat_message_cpp_def.h:1201
std::function< void(const QChatGetThreadMessagesResp &)> GetThreadMessagesCallback
查询Thread消息回调
Definition: nim_qchat_message_cpp_def.h:1199
GetMessagesCallback GetReferMessagesCallback
获取关联消息回调
Definition: nim_qchat_message_cpp_def.h:1197
std::function< void(const QChatMessageSearchPageResp &)> MessageSearchPageCallback
消息分页搜索回调
Definition: nim_qchat_message_cpp_def.h:1207
std::function< void(const QChatRecvMsgResp &)> RecvMsgCallback
接收消息回调
Definition: nim_qchat_message_cpp_def.h:1177
std::function< void(const QChatGetQuickCommentsResp &)> GetQuickCommentsCallback
查询快捷回复回调
Definition: nim_qchat_message_cpp_def.h:1205
std::function< void(const QChatUpdateMessageResp &)> UpdateMsgCallback
更新消息回调
Definition: nim_qchat_message_cpp_def.h:1181
std::function< void(const QChatReplyMessageResp &)> ReplyMessageCallback
回复消息回调
Definition: nim_qchat_message_cpp_def.h:1193
bool ParseJsonValue(const std::string &content, nim_cpp_wrapper_util::Json::Value &values)
解析JsonString
Definition: nim_json_util.cpp:70
std::string GetJsonStringWithNoStyled(const nim_cpp_wrapper_util::Json::Value &values)
获得非格式化的Json string,传入SDK的json string格式要求为非格式化的,如果是格式化的json string可能会影响功能
Definition: nim_json_util.cpp:89
@ kNIMResSuccess
Definition: nim_chatroom_res_code_def.h:18
圈组CPP wrapper helpers
NIMQChatGetReferMessageType
Definition: nim_qchat_message_def.h:76
NIMQChatQuickCommentOperation
Definition: nim_qchat_message_def.h:68
NIMQChatMsgType
Definition: nim_qchat_message_def.h:44
@ kNIMQChatMsgTypeNotification
通知类型消息
Definition: nim_qchat_message_def.h:56
@ kNIMQChatMsgTypeVideo
视频类型消息
Definition: nim_qchat_message_def.h:52
@ kNIMQChatMsgTypeText
文本类型消息
Definition: nim_qchat_message_def.h:46
@ kNIMQChatMsgTypeTips
提醒类型消息
Definition: nim_qchat_message_def.h:60
@ kNIMQChatMsgTypeAudio
音频类型消息
Definition: nim_qchat_message_def.h:50
@ kNIMQChatMsgTypeLocation
位置类型消息
Definition: nim_qchat_message_def.h:54
@ kNIMQChatMsgTypeFile
文件类型消息
Definition: nim_qchat_message_def.h:58
@ kNIMQChatMsgTypeUnknown
未知类型消息,作为默认值
Definition: nim_qchat_message_def.h:64
@ kNIMQChatMsgTypeImage
图片类型消息
Definition: nim_qchat_message_def.h:48
NIMQChatMessageStatus
Definition: nim_qchat_message_def.h:23
@ kMsgStatusRevoke
被撤回的消息
Definition: nim_qchat_message_def.h:27
@ kMsgStatusNormal
普通消息状态
Definition: nim_qchat_message_def.h:25
@ kMsgStatusDelete
被删除的消息
Definition: nim_qchat_message_def.h:29
NIMQChatMessageNotifyReason
Definition: nim_qchat_message_def.h:34
@ kMessageNotifyReasonUnkonw
未知原因
Definition: nim_qchat_message_def.h:36
@ kNIMLocalResMsgAccessDenied
禁止访问
Definition: nim_qchat_public_def.h:276
NIMQChatMessageSearchSort
消息搜索排序规则
Definition: nim_qchat_public_def.h:108
NIMQChatSearchOrder
搜索排序顺序
Definition: nim_qchat_public_def.h:82
Definition: nim_qchat_message_def.h:103
Definition: nim_qchat_public_def.h:130
Definition: nim_qchat_message_def.h:86
Definition: nim_qchat_message_def.h:587
NIMQChatMessageUpdateInfo update_info
更新信息
Definition: nim_qchat_message_def.h:599
NIMQChatChannelIDInfo id_info
频道ID信息
Definition: nim_qchat_message_def.h:593
uint64_t timestamp
消息发送时间戳
Definition: nim_qchat_message_def.h:597
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:591
nim_qchat_update_msg_cb_func cb
发送消息异步回调
Definition: nim_qchat_message_def.h:589
uint64_t msg_server_id
消息服务器 id
Definition: nim_qchat_message_def.h:595
Definition: nim_qchat_message_def.h:140
Definition: nim_qchat_message_def.h:625
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:629
uint64_t * channel_ids
频道ID
Definition: nim_qchat_message_def.h:633
uint64_t server_id
服务器ID
Definition: nim_qchat_message_def.h:631
nim_qchat_get_last_messages_cb_func cb
查询历史消息异步回调
Definition: nim_qchat_message_def.h:627
size_t channel_ids_count
频道ID数量
Definition: nim_qchat_message_def.h:635
Definition: nim_qchat_message_def.h:675
Definition: nim_qchat_message_def.h:683
size_t column_count
查询的消息数量
Definition: nim_qchat_message_def.h:692
uint64_t channel_id
频道 ID
Definition: nim_qchat_message_def.h:688
NIMQChatGetMessageColumns * columns
消息列表
Definition: nim_qchat_message_def.h:690
uint64_t server_id
服务器 ID
Definition: nim_qchat_message_def.h:686
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:694
Definition: nim_qchat_message_def.h:639
nim_qchat_query_history_msg_cache_cb_func cb
查询本地缓存消息历史异步回调
Definition: nim_qchat_message_def.h:641
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:647
uint64_t channel_id
频道 ID
Definition: nim_qchat_message_def.h:645
uint64_t server_id
服务器 ID
Definition: nim_qchat_message_def.h:643
Definition: nim_qchat_message_def.h:603
uint64_t server_id
服务器ID
Definition: nim_qchat_message_def.h:609
uint32_t limit
查询条数
Definition: nim_qchat_message_def.h:619
bool reverse
是否倒序, false: 否, true: 是
Definition: nim_qchat_message_def.h:621
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:607
nim_qchat_query_history_msg_cb_func cb
查询历史消息异步回调
Definition: nim_qchat_message_def.h:605
uint64_t exclude_msg_server_id
排除某条消息, msg server id
Definition: nim_qchat_message_def.h:617
uint64_t from_time
查询开始时间
Definition: nim_qchat_message_def.h:613
uint64_t to_time
查询结束时间
Definition: nim_qchat_message_def.h:615
uint64_t channel_id
频道ID
Definition: nim_qchat_message_def.h:611
Definition: nim_qchat_message_def.h:357
size_t messages_count
消息数量
Definition: nim_qchat_message_def.h:363
NIMQChatMessage * messages
消息列表
Definition: nim_qchat_message_def.h:365
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:359
Definition: nim_qchat_message_def.h:763
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:775
size_t msg_server_id_count
消息服务器 ID 列表数量
Definition: nim_qchat_message_def.h:773
uint64_t * msg_server_id_list
消息服务器 ID 列表
Definition: nim_qchat_message_def.h:771
uint64_t server_id
服务器ID
Definition: nim_qchat_message_def.h:767
uint64_t channel_id
频道ID
Definition: nim_qchat_message_def.h:769
nim_qchat_get_quick_comments_cb_func cb
获取快捷评论异步回调
Definition: nim_qchat_message_def.h:765
Definition: nim_qchat_message_def.h:419
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:421
Definition: nim_qchat_message_def.h:698
nim_qchat_get_refer_messages_cb_func cb
获取引用消息异步回调
Definition: nim_qchat_message_def.h:700
NIMQChatGetReferMessageType type
查询的类型
Definition: nim_qchat_message_def.h:702
NIMQChatMessage message
要查询的消息体
Definition: nim_qchat_message_def.h:704
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:706
Definition: nim_qchat_message_def.h:710
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:714
uint64_t exclude_msg_server_id
排除某条消息, message server id
Definition: nim_qchat_message_def.h:720
nim_qchat_get_thread_messages_cb_func cb
查询 thread 消息异步回调
Definition: nim_qchat_message_def.h:712
uint32_t limit
查询条数
Definition: nim_qchat_message_def.h:722
bool reverse
是否倒序, false: 否, true: 是
Definition: nim_qchat_message_def.h:724
uint64_t from_time
查询开始时间
Definition: nim_qchat_message_def.h:716
uint64_t to_time
查询结束时间
Definition: nim_qchat_message_def.h:718
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:726
Definition: nim_qchat_message_def.h:441
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:443
Definition: nim_qchat_message_def.h:730
uint64_t channel_id
频道ID
Definition: nim_qchat_message_def.h:736
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:742
nim_qchat_get_thread_messages_meta_cb_func cb
查询 thread 消息元信息异步回调
Definition: nim_qchat_message_def.h:732
size_t message_count
要查询的 thread root 消息数量
Definition: nim_qchat_message_def.h:740
NIMQChatMessage * messages
要查询的 thread root 消息列表
Definition: nim_qchat_message_def.h:738
uint64_t server_id
服务器ID
Definition: nim_qchat_message_def.h:734
Definition: nim_qchat_message_def.h:453
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:455
NIMQChatThreadMessageMetaInfo * meta_infos
消息元信息
Definition: nim_qchat_message_def.h:457
size_t meta_info_count
消息元信息数量
Definition: nim_qchat_message_def.h:459
Definition: nim_qchat_message_def.h:91
Definition: nim_qchat_message_def.h:127
Definition: nim_qchat_message_def.h:651
NIMQChatChannelIDInfo id_info
标记已读channel ID
Definition: nim_qchat_message_def.h:657
uint64_t timestamp
标记消息已读时间戳
Definition: nim_qchat_message_def.h:659
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:655
nim_qchat_ack_cb_func cb
标记消息已读异步回调
Definition: nim_qchat_message_def.h:653
Definition: nim_qchat_message_def.h:344
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:346
NIMQChatUnreadInfo unread_info
未读数信息
Definition: nim_qchat_message_def.h:350
Definition: nim_qchat_public_def.h:159
bool use_custom_content
是否需要使用自定义反垃圾字段(即antiSpamContent), false:不需要, true:需要, 默认0, 一般使用的情况是通用反垃圾转易盾
Definition: nim_qchat_public_def.h:161
bool anti_spam_using_yidun
单条消息是否使用易盾反垃圾, false:(在开通易盾的情况下)不过易盾反垃圾, 其他都是按照原来的规则
Definition: nim_qchat_public_def.h:163
char * yidun_anti_spam_ext
易盾反垃圾扩展字段, 限制json, 长度限制1024
Definition: nim_qchat_public_def.h:173
char * anti_spam_content
反垃圾内容, 开发者自定义的反垃圾字段, 如果提供了这个字段, 在过反垃圾时不会再使用body或者attach
Definition: nim_qchat_public_def.h:165
char * anti_spam_bussiness_id
反垃圾业务ID, 对某些单条消息另外的反垃圾的业务ID
Definition: nim_qchat_public_def.h:167
char * yidun_callback_url
易盾check的回调URL
Definition: nim_qchat_public_def.h:169
char * yidun_anti_cheating
易盾反垃圾增强反作弊专属字段, 限制json, 长度限制1024
Definition: nim_qchat_public_def.h:171
Definition: nim_qchat_message_def.h:202
uint32_t msg_sub_type
消息子类型
Definition: nim_qchat_message_def.h:210
bool need_push_nick
是否需要推送昵称, false: 不需要, true: 需要, 默认 true
Definition: nim_qchat_message_def.h:238
uint32_t from_client_type
消息发送者的客户端类型
Definition: nim_qchat_message_def.h:281
NIMQChatNotificationAttach notification_attach
通知消息附件
Definition: nim_qchat_message_def.h:265
bool route_enable
是否需要抄送, false: 不需要, true: 需要, 默认 true
Definition: nim_qchat_message_def.h:240
size_t mention_accids_count
@成员列表长度
Definition: nim_qchat_message_def.h:222
char * env
环境变量,用于指向不同的抄送、第三方回调等配置
Definition: nim_qchat_message_def.h:250
char * push_payload
自定义的推送属性,限制json
Definition: nim_qchat_message_def.h:230
NIMQChatMsgType msg_type
消息类型
Definition: nim_qchat_message_def.h:208
NIMQChatTipsAttach tips_attach
提醒消息附件
Definition: nim_qchat_message_def.h:269
char ** mention_accids
@成员列表
Definition: nim_qchat_message_def.h:220
NIMQChatVideoAttach video_attach
视频消息附件
Definition: nim_qchat_message_def.h:261
bool history_enable
该消息是否存储云端历史,0:不支持,1:支持
Definition: nim_qchat_message_def.h:228
uint64_t server_id
消息所属的server id
Definition: nim_qchat_message_def.h:204
bool accids_of_mentioned_roles_available
@身份组所包含的accid列表是否有效
Definition: nim_qchat_message_def.h:298
bool mention_all
是否@所有人,false:否,true:是
Definition: nim_qchat_message_def.h:218
uint64_t channel_id
消息所属的channel id
Definition: nim_qchat_message_def.h:206
char * callback_ext
第三方回调扩展字段
Definition: nim_qchat_message_def.h:252
char * from_accid
消息发送者的accid
Definition: nim_qchat_message_def.h:279
bool push_enable
是否需要推送, false: 不需要, true: 需要, 默认 false
Definition: nim_qchat_message_def.h:234
NIMQChatMessageThreadInfo thread_info
回复消息信息
Definition: nim_qchat_message_def.h:242
char * push_content
自定义的推送内容
Definition: nim_qchat_message_def.h:232
NIMQChatImageAttach image_attach
图片消息附件
Definition: nim_qchat_message_def.h:257
char * from_device_id
消息发送者的设备id
Definition: nim_qchat_message_def.h:283
uint64_t * mention_role_ids
@身份组列表
Definition: nim_qchat_message_def.h:224
char ** accids_of_mentioned_roles
@身份组所包含的accid列表(部分)
Definition: nim_qchat_message_def.h:300
NIMQChatFileAttach file_attach
文件消息附件
Definition: nim_qchat_message_def.h:267
bool need_badge
是否需要消息计数, false: 不需要, true: 需要, 默认 true
Definition: nim_qchat_message_def.h:236
NIMQChatAudioAttach audio_attach
音频消息附件
Definition: nim_qchat_message_def.h:259
uint64_t update_timestamp
消息更新时间戳
Definition: nim_qchat_message_def.h:289
size_t mention_role_ids_count
@身份组列表长度
Definition: nim_qchat_message_def.h:226
char * from_nick
消息发送者的昵称
Definition: nim_qchat_message_def.h:285
NIMQChatLocationAttach location_attach
位置消息附件
Definition: nim_qchat_message_def.h:263
char * msg_ext
消息扩展字段
Definition: nim_qchat_message_def.h:214
NIMQChatMessageNotifyReason notify_reason
消息下发原因
Definition: nim_qchat_message_def.h:291
uint64_t timestamp
消息发送时间戳
Definition: nim_qchat_message_def.h:287
uint64_t msg_server_id
消息服务器 id
Definition: nim_qchat_message_def.h:277
NIMQChatMessageAntiSpamInfo anti_spam_info
反垃圾信息
Definition: nim_qchat_message_def.h:244
NIMQChatDefaultAttach default_attach
默认附件
Definition: nim_qchat_message_def.h:255
char * msg_body
消息内容
Definition: nim_qchat_message_def.h:212
NIMQChatMessageStatus status
消息状态
Definition: nim_qchat_message_def.h:273
size_t accids_of_mentioned_roles_count
@身份组所包含的accid列表长度(部分)
Definition: nim_qchat_message_def.h:302
char * anti_spam_result
反垃圾结果
Definition: nim_qchat_message_def.h:248
NIMQChatMessageUpdateOpeInfo update_ope_info
上次消息变更操作信息
Definition: nim_qchat_message_def.h:295
char * msg_id
消息id
Definition: nim_qchat_message_def.h:275
NIMQChatMessageUpdateContent update_content
上次消息变更内容
Definition: nim_qchat_message_def.h:293
bool resend_flag
重发标记,false:不是重发,true:是重发
Definition: nim_qchat_message_def.h:216
bool is_anti_spamed
是否被反垃圾拦截, false: 未被拦截, true: 已被拦截, 默认 false
Definition: nim_qchat_message_def.h:246
Definition: nim_qchat_message_def.h:779
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:783
uint64_t channel_id
频道ID
Definition: nim_qchat_message_def.h:789
char * from_accid
消息发送者ID
Definition: nim_qchat_message_def.h:791
uint64_t from_time
搜索的开始时间
Definition: nim_qchat_message_def.h:793
size_t msg_types_count
搜索的消息类型数量
Definition: nim_qchat_message_def.h:797
char * keyword
搜索的关键字
Definition: nim_qchat_message_def.h:785
NIMQChatSearchOrder order
排序顺序
Definition: nim_qchat_message_def.h:807
uint64_t server_id
服务器ID
Definition: nim_qchat_message_def.h:787
NIMQChatMsgType * msg_types
搜索的消息类型
Definition: nim_qchat_message_def.h:799
uint32_t * sub_types
搜索的消息子类型
Definition: nim_qchat_message_def.h:803
char * cursor
查询游标, 查询的起始位置
Definition: nim_qchat_message_def.h:813
size_t sub_types_count
搜索的消息子类型数量
Definition: nim_qchat_message_def.h:801
NIMQChatMessageSearchSort sort
排序规则
Definition: nim_qchat_message_def.h:809
bool include_self
是否包含自己的消息
Definition: nim_qchat_message_def.h:805
uint64_t to_time
搜索的结束时间
Definition: nim_qchat_message_def.h:795
nim_qchat_message_search_page_cb_func cb
消息搜索异步回调
Definition: nim_qchat_message_def.h:781
uint32_t limit
查询条数
Definition: nim_qchat_message_def.h:811
Definition: nim_qchat_message_def.h:465
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:469
size_t messages_count
消息数量
Definition: nim_qchat_message_def.h:473
NIMQChatMessage * messages
消息列表
Definition: nim_qchat_message_def.h:475
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:467
NIMQChatPageInfo page_info
分页信息
Definition: nim_qchat_message_def.h:471
Definition: nim_qchat_message_def.h:156
char * reply_from_accid
被回复的消息所有者 ID
Definition: nim_qchat_message_def.h:158
char * thread_root_accid
thread 根消息的所有者 ID
Definition: nim_qchat_message_def.h:166
char * reply_msg_client_id
被回复消息得客户端消息 ID
Definition: nim_qchat_message_def.h:164
uint64_t reply_msg_timestamp
被回复消息得创建时间
Definition: nim_qchat_message_def.h:160
uint64_t thread_root_msg_timestamp
thread 根消息的创建时间
Definition: nim_qchat_message_def.h:168
uint64_t thread_root_msg_server_id
thread 根消息的服务器消息 ID
Definition: nim_qchat_message_def.h:170
char * thread_root_msg_client_id
thread 根消息的客户端消息 ID
Definition: nim_qchat_message_def.h:172
uint64_t reply_msg_server_id
被回复消息得服务器消息 ID
Definition: nim_qchat_message_def.h:162
Definition: nim_qchat_message_def.h:176
NIMQChatMessageStatus status
消息状态
Definition: nim_qchat_message_def.h:178
char * msg_ext
消息扩展字段
Definition: nim_qchat_message_def.h:182
char * msg_body
消息内容
Definition: nim_qchat_message_def.h:180
Definition: nim_qchat_public_def.h:138
char * push_content
推送文案
Definition: nim_qchat_public_def.h:144
char * push_payload
推送payload
Definition: nim_qchat_public_def.h:146
bool route_enable
是否需要抄送
Definition: nim_qchat_public_def.h:150
char * extension
操作扩展字段
Definition: nim_qchat_public_def.h:142
char * operator_id
操作者账号
Definition: nim_qchat_public_def.h:153
char * env
环境变量,用于指向不同的抄送、第三方回调等配置
Definition: nim_qchat_public_def.h:148
uint32_t operator_client_type
操作者客户端类型
Definition: nim_qchat_public_def.h:155
char * postscript
操作附言
Definition: nim_qchat_public_def.h:140
Definition: nim_qchat_message_def.h:186
uint32_t operator_client_type
操作者客户端类型
Definition: nim_qchat_message_def.h:190
char * push_payload
推送payload
Definition: nim_qchat_message_def.h:198
char * push_content
推送文案
Definition: nim_qchat_message_def.h:196
char * operator_id
操作者账号
Definition: nim_qchat_message_def.h:188
char * postscript
操作附言
Definition: nim_qchat_message_def.h:192
char * extension
操作扩展字段
Definition: nim_qchat_message_def.h:194
Definition: nim_qchat_message_def.h:306
NIMQChatMessageUpdateInfo update_info
消息更新信息
Definition: nim_qchat_message_def.h:310
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:312
Definition: nim_qchat_message_def.h:134
Definition: nim_qchat_message_def.h:387
size_t account_count
account ID 总数
Definition: nim_qchat_message_def.h:397
uint64_t count
这个评论的数量
Definition: nim_qchat_message_def.h:391
bool include_yourself
是否包含自己
Definition: nim_qchat_message_def.h:393
uint64_t type
评论类型
Definition: nim_qchat_message_def.h:389
char ** accids
若干个添加过评论的 account ID
Definition: nim_qchat_message_def.h:395
Definition: nim_qchat_message_def.h:401
uint64_t server_id
评论所在服务器 ID
Definition: nim_qchat_message_def.h:403
uint64_t count
总的评论数量
Definition: nim_qchat_message_def.h:409
NIMQChatQuickCommentDetail * detail
评论详情
Definition: nim_qchat_message_def.h:413
size_t detail_count
评论详情数量
Definition: nim_qchat_message_def.h:415
uint64_t msg_server_id
评论所属消息服务器 ID
Definition: nim_qchat_message_def.h:407
uint64_t timestamp
最后一次操作的时间
Definition: nim_qchat_message_def.h:411
uint64_t channel_id
评论所在频道 ID
Definition: nim_qchat_message_def.h:405
Definition: nim_qchat_message_def.h:316
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:320
Definition: nim_qchat_message_def.h:526
nim_qchat_msg_updated_cb_func cb
消息更新异步回调
Definition: nim_qchat_message_def.h:528
Definition: nim_qchat_message_def.h:518
nim_qchat_recv_msg_cb_func cb
接收消息异步回调
Definition: nim_qchat_message_def.h:520
Definition: nim_qchat_message_def.h:663
nim_qchat_reply_msg_cb_func cb
发送消息异步回调
Definition: nim_qchat_message_def.h:665
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:671
NIMQChatMessage quote_message
被引用的消息体
Definition: nim_qchat_message_def.h:667
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:669
Definition: nim_qchat_message_def.h:571
uint64_t timestamp
消息发送时间戳
Definition: nim_qchat_message_def.h:581
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:575
nim_qchat_update_msg_cb_func cb
发送消息异步回调
Definition: nim_qchat_message_def.h:573
NIMQChatChannelIDInfo id_info
频道ID信息
Definition: nim_qchat_message_def.h:577
NIMQChatMessageUpdateInfo update_info
更新信息
Definition: nim_qchat_message_def.h:583
uint64_t msg_server_id
消息服务器 id
Definition: nim_qchat_message_def.h:579
Definition: nim_qchat_message_def.h:534
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:538
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:540
nim_qchat_send_msg_cb_func cb
发送消息异步回调
Definition: nim_qchat_message_def.h:536
Definition: nim_qchat_message_def.h:324
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:330
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:326
Definition: nim_qchat_message_def.h:429
uint64_t thread_msg_timestamp
thread 消息时间戳
Definition: nim_qchat_message_def.h:437
uint64_t thread_msg_server_id
thread 消息服务器 ID
Definition: nim_qchat_message_def.h:435
Definition: nim_qchat_message_def.h:150
Definition: nim_qchat_public_def.h:330
Definition: nim_qchat_message_def.h:544
uint32_t msg_sub_type
消息子类型
Definition: nim_qchat_message_def.h:567
NIMQChatMessageUpdateInfo update_info
更新信息
Definition: nim_qchat_message_def.h:556
uint64_t msg_server_id
消息服务器 id
Definition: nim_qchat_message_def.h:552
NIMQChatChannelIDInfo id_info
频道ID信息
Definition: nim_qchat_message_def.h:550
void * user_data
自定义用户数据
Definition: nim_qchat_message_def.h:548
NIMQChatMessageStatus status
消息状态, 不允许更新为删除或撤回
Definition: nim_qchat_message_def.h:561
uint64_t timestamp
消息发送时间戳
Definition: nim_qchat_message_def.h:554
char * msg_ext
消息扩展字段
Definition: nim_qchat_message_def.h:565
NIMQChatMessageAntiSpamInfo anti_spam_info
反垃圾信息
Definition: nim_qchat_message_def.h:558
char * msg_body
消息体
Definition: nim_qchat_message_def.h:563
nim_qchat_update_msg_cb_func cb
发送消息异步回调
Definition: nim_qchat_message_def.h:546
Definition: nim_qchat_message_def.h:334
NIMQChatMessage message
消息体
Definition: nim_qchat_message_def.h:340
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_def.h:336
Definition: nim_qchat_message_def.h:114
Definition: nim_qchat_message_cpp_def.h:22
Definition: nim_qchat_message_cpp_def.h:148
Definition: nim_qchat_public_cpp_def.h:40
Definition: nim_qchat_message_cpp_def.h:30
Definition: nim_qchat_message_cpp_def.h:1376
Definition: nim_qchat_message_cpp_def.h:45
Definition: nim_qchat_message_cpp_def.h:1450
Definition: nim_qchat_message_cpp_def.h:904
Definition: nim_qchat_message_cpp_def.h:1568
Definition: nim_qchat_message_cpp_def.h:1484
uint64_t server_id
服务器 ID
Definition: nim_qchat_message_cpp_def.h:1488
uint64_t channel_id
频道 ID
Definition: nim_qchat_message_cpp_def.h:1490
Definition: nim_qchat_message_cpp_def.h:1399
Definition: nim_qchat_message_cpp_def.h:873
Definition: nim_qchat_message_cpp_def.h:1760
uint64_t channel_id
频道 ID
Definition: nim_qchat_message_cpp_def.h:1766
std::vector< uint64_t > msg_server_id_list
要查询的服务器消息 ID 列表
Definition: nim_qchat_message_cpp_def.h:1768
uint64_t server_id
服务器 ID
Definition: nim_qchat_message_cpp_def.h:1764
Definition: nim_qchat_message_cpp_def.h:1113
Definition: nim_qchat_message_cpp_def.h:1602
Definition: nim_qchat_message_cpp_def.h:1629
QChatMessage message
要查询的 thread 依据完整消息体
Definition: nim_qchat_message_cpp_def.h:1633
Definition: nim_qchat_message_cpp_def.h:963
std::list< QChatMessage > messages
消息列表
Definition: nim_qchat_message_cpp_def.h:971
NIMQChatThreadMessageMetaInfo meta_info
thread 消息元信息
Definition: nim_qchat_message_cpp_def.h:967
QChatMessage root_message
消息体
Definition: nim_qchat_message_cpp_def.h:969
Definition: nim_qchat_message_cpp_def.h:1714
GetThreadRootMessagesMetaCallback cb
回调函数
Definition: nim_qchat_message_cpp_def.h:1716
Definition: nim_qchat_message_cpp_def.h:1003
std::vector< NIMQChatThreadMessageMetaInfo > meta_infos
thread 消息元信息
Definition: nim_qchat_message_cpp_def.h:1007
Definition: nim_qchat_message_cpp_def.h:102
Definition: nim_qchat_message_cpp_def.h:238
Definition: nim_qchat_message_cpp_def.h:1506
Definition: nim_qchat_message_cpp_def.h:944
Definition: nim_qchat_message_cpp_def.h:386
std::string yidun_callback_url
易盾check的回调URL
Definition: nim_qchat_message_cpp_def.h:396
std::string anti_spam_content
反垃圾内容, 开发者自定义的反垃圾字段, 如果提供了这个字段, 在过反垃圾时不会再使用body或者attach
Definition: nim_qchat_message_cpp_def.h:392
std::string anti_spam_bussiness_id
反垃圾业务ID, 对某些单条消息另外的反垃圾的业务ID
Definition: nim_qchat_message_cpp_def.h:394
std::string yidun_anti_spam_ext
易盾反垃圾扩展字段, 限制json, 长度限制1024
Definition: nim_qchat_message_cpp_def.h:400
std::string yidun_anti_cheating
易盾反垃圾增强反作弊专属字段, 限制json, 长度限制1024
Definition: nim_qchat_message_cpp_def.h:398
Definition: nim_qchat_message_cpp_def.h:715
std::string callback_ext
第三方回调扩展字段
Definition: nim_qchat_message_cpp_def.h:740
std::string anti_spam_result
反垃圾结果
Definition: nim_qchat_message_cpp_def.h:738
uint64_t timestamp
更新消息时消息创建的时间戳,以服务器返回信息为准
Definition: nim_qchat_message_cpp_def.h:730
QChatMessageUpdateContent update_content
上次消息变更内容
Definition: nim_qchat_message_cpp_def.h:742
QChatMessageUpdateOpeInfo update_ope_info
上次消息变更操作信息
Definition: nim_qchat_message_cpp_def.h:744
uint64_t msg_server_id
更新消息时消息服务器端id
Definition: nim_qchat_message_cpp_def.h:720
std::vector< std::string > accids_of_mentioned_roles
@身份组所包含的accid列表(部分)
Definition: nim_qchat_message_cpp_def.h:798
Definition: nim_qchat_message_cpp_def.h:1799
uint32_t limit
查询条数
Definition: nim_qchat_message_cpp_def.h:1825
uint64_t server_id
服务器 ID
Definition: nim_qchat_message_cpp_def.h:1805
uint64_t channel_id
频道 ID
Definition: nim_qchat_message_cpp_def.h:1807
std::vector< uint32_t > sub_types
搜索消息类型
Definition: nim_qchat_message_cpp_def.h:1817
std::vector< NIMQChatMsgType > msg_types
搜索消息类型
Definition: nim_qchat_message_cpp_def.h:1815
std::string cursor
查询游标, 查询的起始位置
Definition: nim_qchat_message_cpp_def.h:1827
NIMQChatSearchOrder order
排序顺序
Definition: nim_qchat_message_cpp_def.h:1821
uint64_t to_time
搜索的结束时间
Definition: nim_qchat_message_cpp_def.h:1813
uint64_t from_time
搜索的开始时间
Definition: nim_qchat_message_cpp_def.h:1811
std::string keyword
搜索关键字
Definition: nim_qchat_message_cpp_def.h:1803
std::string from_accid
消息发送者ID
Definition: nim_qchat_message_cpp_def.h:1809
NIMQChatMessageSearchSort sort
排序规则
Definition: nim_qchat_message_cpp_def.h:1823
Definition: nim_qchat_message_cpp_def.h:1145
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_message_cpp_def.h:1147
std::vector< QChatMessage > messages
消息列表
Definition: nim_qchat_message_cpp_def.h:1151
QChatPageInfo page_info
分页信息
Definition: nim_qchat_message_cpp_def.h:1149
Definition: nim_qchat_message_cpp_def.h:468
QChatMessageThreadInfo thread_info
thread 消息相关信息
Definition: nim_qchat_message_cpp_def.h:508
std::string env
环境变量
Definition: nim_qchat_message_cpp_def.h:512
QChatMessageAntiSpamInfo anti_spam_info
反垃圾信息
Definition: nim_qchat_message_cpp_def.h:510
Definition: nim_qchat_message_cpp_def.h:425
std::string thread_root_accid
thread 根消息的所有者 ID
Definition: nim_qchat_message_cpp_def.h:435
std::string reply_msg_client_id
被回复消息得客户端消息 ID
Definition: nim_qchat_message_cpp_def.h:433
std::string reply_from_accid
被回复的消息所有者 ID
Definition: nim_qchat_message_cpp_def.h:427
std::string thread_root_msg_client_id
thread 根消息的客户端消息 ID
Definition: nim_qchat_message_cpp_def.h:441
Definition: nim_qchat_message_cpp_def.h:657
NIMQChatMessageStatus status
消息状态
Definition: nim_qchat_message_cpp_def.h:659
std::string msg_ext
消息扩展字段
Definition: nim_qchat_message_cpp_def.h:663
std::string msg_body
消息内容
Definition: nim_qchat_message_cpp_def.h:661
Definition: nim_qchat_message_cpp_def.h:344
std::string postscript
操作附言
Definition: nim_qchat_message_cpp_def.h:346
std::string push_content
推送文案
Definition: nim_qchat_message_cpp_def.h:350
std::string push_payload
推送payload
Definition: nim_qchat_message_cpp_def.h:352
bool route_enable
是否需要抄送
Definition: nim_qchat_message_cpp_def.h:356
std::string extension
操作扩展字段
Definition: nim_qchat_message_cpp_def.h:348
std::string env
环境变量,用于指向不同的抄送、第三方回调等配置
Definition: nim_qchat_message_cpp_def.h:354
Definition: nim_qchat_message_cpp_def.h:680
std::string operator_id
操作者账号
Definition: nim_qchat_message_cpp_def.h:682
uint32_t operator_client_type
操作者客户端类型
Definition: nim_qchat_message_cpp_def.h:684
std::string push_content
推送文案
Definition: nim_qchat_message_cpp_def.h:690
std::string extension
操作扩展字段
Definition: nim_qchat_message_cpp_def.h:688
std::string postscript
操作附言
Definition: nim_qchat_message_cpp_def.h:686
std::string push_payload
推送payload
Definition: nim_qchat_message_cpp_def.h:692
Definition: nim_qchat_message_cpp_def.h:813
Definition: nim_qchat_message_cpp_def.h:277
Definition: nim_qchat_public_cpp_def.h:72
Definition: nim_qchat_message_cpp_def.h:1033
uint64_t type
表示评论类型
Definition: nim_qchat_message_cpp_def.h:1035
uint64_t count
表示这个评论的数量
Definition: nim_qchat_message_cpp_def.h:1037
bool include_yourself
表示自己是否添加过这个标签
Definition: nim_qchat_message_cpp_def.h:1039
std::list< std::string > accids
若干个添加过表情的 account ID
Definition: nim_qchat_message_cpp_def.h:1041
Definition: nim_qchat_message_cpp_def.h:1069
uint64_t count
总的评论数量
Definition: nim_qchat_message_cpp_def.h:1077
uint64_t channel_id
评论所在频道
Definition: nim_qchat_message_cpp_def.h:1073
uint64_t timestamp
最后一次操作的时间
Definition: nim_qchat_message_cpp_def.h:1079
uint64_t msg_server_id
评论所属的消息服务器 ID
Definition: nim_qchat_message_cpp_def.h:1075
uint64_t server_id
评论所在服务器
Definition: nim_qchat_message_cpp_def.h:1071
std::list< QChatQuickCommentDetail > details
评论详情
Definition: nim_qchat_message_cpp_def.h:1081
Definition: nim_qchat_message_cpp_def.h:1676
QChatMessage message
快速评论内容
Definition: nim_qchat_message_cpp_def.h:1680
uint32_t type
快速评论类型,是一个数组,大于 0
Definition: nim_qchat_message_cpp_def.h:1682
Definition: nim_qchat_message_cpp_def.h:805
Definition: nim_qchat_message_cpp_def.h:1226
Definition: nim_qchat_message_cpp_def.h:1210
Definition: nim_qchat_message_cpp_def.h:1537
QChatMessageSend message
回复消息内容
Definition: nim_qchat_message_cpp_def.h:1543
QChatMessage quote_message
被引用的消息体
Definition: nim_qchat_message_cpp_def.h:1541
Definition: nim_qchat_message_cpp_def.h:1353
Definition: nim_qchat_message_cpp_def.h:1242
Definition: nim_qchat_message_cpp_def.h:828
Definition: nim_qchat_message_cpp_def.h:310
Definition: nim_qchat_message_cpp_def.h:1269
Definition: nim_qchat_message_cpp_def.h:852
Definition: nim_qchat_message_cpp_def.h:187