NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_talk_helper.h
浏览该文件的文档.
1
7#ifndef _NIM_SDK_CPP_TALK_HELPER_H_
8#define _NIM_SDK_CPP_TALK_HELPER_H_
9
10#include <functional>
11#include <list>
12#include <string>
16#include "nim_define_include.h"
22namespace nim {
23
49 std::string push_content_;
53 std::string local_ext_;
57 std::list<std::string> force_push_ids_list_;
63 std::string anti_spam_content_;
65 std::string anti_apam_biz_id_;
81 std::string env_config_;
83 std::string anti_spam_ext;
85 std::string anti_spam_res;
86
89 : resend_flag_(BS_NOT_INIT)
90 , server_history_saved_(BS_NOT_INIT)
91 , roaming_(BS_NOT_INIT)
92 , self_sync_(BS_NOT_INIT)
93 , need_push_(BS_NOT_INIT)
94 , push_need_badge_(BS_NOT_INIT)
95 , push_need_prefix_(BS_NOT_INIT)
96 , routable_(BS_NOT_INIT)
97 , is_blacklisted_(BS_NOT_INIT)
98 , need_offline_(BS_NOT_INIT)
99 , is_force_push_(BS_NOT_INIT)
100 , anti_spam_enable_(BS_NOT_INIT)
101 , anti_apam_using_yidun_(1)
102 , client_anti_spam_hitting_(BS_NOT_INIT)
103 , team_msg_need_ack_(BS_NOT_INIT)
104 , team_msg_ack_sent_(BS_NOT_INIT)
105 , team_msg_unread_count_(-1)
106 , is_update_session_(BS_NOT_INIT) {}
107
114 if (server_history_saved_ != BS_NOT_INIT)
115 message[kNIMMsgKeyHistorySave] = server_history_saved_;
116 if (roaming_ != BS_NOT_INIT)
117 message[kNIMMsgKeyMsgRoaming] = roaming_;
118 if (self_sync_ != BS_NOT_INIT)
119 message[kNIMMsgKeyMsgSync] = self_sync_;
120 if (push_need_badge_ != BS_NOT_INIT)
121 message[kNIMMsgKeyPushNeedBadge] = push_need_badge_;
122 if (need_push_ != BS_NOT_INIT)
123 message[kNIMMsgKeyPushEnable] = need_push_;
124 if (push_need_prefix_ != BS_NOT_INIT)
125 message[kNIMMsgKeyPushNeedPrefix] = push_need_prefix_;
126 if (resend_flag_ != BS_NOT_INIT)
127 message[kNIMMsgKeyResendFlag] = resend_flag_;
128 if (routable_ != BS_NOT_INIT)
129 message[kNIMMsgKeyMsgRoutable] = routable_;
130 if (is_blacklisted_ != BS_NOT_INIT)
131 message[kNIMMsgKeyIsBlacklisted] = is_blacklisted_;
132 if (need_offline_ != BS_NOT_INIT)
133 message[kNIMMsgKeySetMsgOffline] = need_offline_;
134 if (!push_payload_.empty())
135 message[kNIMMsgKeyPushPayload] = GetJsonStringWithNoStyled(push_payload_);
136 if (!push_content_.empty())
137 message[kNIMMsgKeyPushContent] = push_content_;
138 if (!server_ext_.empty())
139 message[kNIMMsgKeyServerExt] = GetJsonStringWithNoStyled(server_ext_);
140 if (!local_ext_.empty())
141 message[kNIMMsgKeyLocalExt] = local_ext_;
142 if (is_force_push_ != BS_NOT_INIT)
143 message[kNIMMsgKeyIsForcePush] = is_force_push_ == BS_TRUE ? 1 : 0;
144 if (!force_push_content_.empty())
145 message[kNIMMsgKeyForcePushContent] = force_push_content_;
146 if (!force_push_ids_list_.empty()) {
147 std::string ids_json;
148 StrListToJsonString(force_push_ids_list_, ids_json);
149 message[kNIMMsgKeyForcePushList] = ids_json;
150 }
151 if (anti_spam_enable_ != BS_NOT_INIT)
152 message[kNIMMsgKeyAntiSpamEnable] = anti_spam_enable_ == BS_TRUE ? 1 : 0;
153 if (!anti_spam_content_.empty())
154 message[kNIMMsgKeyAntiSpamContent] = anti_spam_content_;
155 if (!anti_apam_biz_id_.empty())
156 message[kNIMMsgKeyAntiSpamBizId] = anti_apam_biz_id_;
157 message[kNIMMsgKeyAntiSpamUsingYiDun] = anti_apam_using_yidun_;
158 if (client_anti_spam_hitting_ != BS_NOT_INIT)
159 message[kNIMMsgKeyClientAntiSpam] = client_anti_spam_hitting_;
160 if (team_msg_need_ack_ != BS_NOT_INIT)
161 message[kNIMMsgKeyTeamMsgAck] = team_msg_need_ack_;
162 if (team_msg_ack_sent_ != BS_NOT_INIT)
163 message[kNIMMsgKeyLocalKeyTeamMsgAckSent] = team_msg_ack_sent_;
164 if (team_msg_unread_count_ > -1)
165 message[kNIMMsgKeyLocalKeyTeamMsgUnreadCount] = team_msg_unread_count_;
166 if (is_update_session_ != BS_NOT_INIT)
167 message[kNIMMsgKeyIsUpdateSession] = is_update_session_;
168 if (!yidun_anti_cheating_.empty())
169 message[kNIMMsgKeyAntiCheatingYiDun] = yidun_anti_cheating_;
170 if (!anti_spam_ext.empty())
171 message[kNIMMsgKeyAntiSpamExt] = anti_spam_ext;
172 if (!anti_spam_res.empty())
173 message[kNIMMsgKeyAntiSpamRes] = anti_spam_res;
174 if (!env_config_.empty())
175 message[kNIMMsgKeyEnv] = env_config_;
176 }
179 ToJsonValue(value);
180 return value;
181 }
182
189 if (message.isMember(kNIMMsgKeyHistorySave))
190 server_history_saved_ = message[kNIMMsgKeyHistorySave].asInt() == 1 ? BS_TRUE : BS_FALSE;
191 if (message.isMember(kNIMMsgKeyMsgRoaming))
192 roaming_ = message[kNIMMsgKeyMsgRoaming].asInt() == 1 ? BS_TRUE : BS_FALSE;
193 if (message.isMember(kNIMMsgKeyMsgSync))
194 self_sync_ = message[kNIMMsgKeyMsgSync].asInt() == 1 ? BS_TRUE : BS_FALSE;
196 push_need_badge_ = message[kNIMMsgKeyPushNeedBadge].asInt() == 1 ? BS_TRUE : BS_FALSE;
197 if (message.isMember(kNIMMsgKeyPushEnable))
198 need_push_ = message[kNIMMsgKeyPushEnable].asInt() == 1 ? BS_TRUE : BS_FALSE;
200 push_need_prefix_ = message[kNIMMsgKeyPushNeedPrefix].asInt() == 1 ? BS_TRUE : BS_FALSE;
201 if (message.isMember(kNIMMsgKeyResendFlag))
202 resend_flag_ = message[kNIMMsgKeyResendFlag].asInt() == 1 ? BS_TRUE : BS_FALSE;
203 if (message.isMember(kNIMMsgKeyMsgRoutable))
204 routable_ = message[kNIMMsgKeyMsgRoutable].asInt() == 1 ? BS_TRUE : BS_FALSE;
206 is_blacklisted_ = message[kNIMMsgKeyIsBlacklisted].asInt() == 1 ? BS_TRUE : BS_FALSE;
208 need_offline_ = message[kNIMMsgKeySetMsgOffline].asInt() == 1 ? BS_TRUE : BS_FALSE;
209 if (message.isMember(kNIMMsgKeyServerExt) && !message[kNIMMsgKeyServerExt].asString().empty()) {
210 nim::ParseJsonValue(message[kNIMMsgKeyServerExt].asString(), server_ext_);
211 }
212 if (message.isMember(kNIMMsgKeyPushPayload) && !message[kNIMMsgKeyPushPayload].asString().empty()) {
213 nim::ParseJsonValue(message[kNIMMsgKeyPushPayload].asString(), push_payload_);
214 }
215 local_ext_ = message[kNIMMsgKeyLocalExt].asString();
216 push_content_ = message[kNIMMsgKeyPushContent].asString();
217 if (message.isMember(kNIMMsgKeyIsForcePush))
218 is_force_push_ = message[kNIMMsgKeyIsForcePush].asInt() == 1 ? BS_TRUE : BS_FALSE;
219 force_push_content_ = message[kNIMMsgKeyForcePushContent].asString();
220 if (message[kNIMMsgKeyForcePushList].isString()) {
222 if (nim::ParseJsonValue(message[kNIMMsgKeyForcePushList].asString(), values) && values.isArray())
223 JsonStrArrayToList(values, force_push_ids_list_);
224 else {
225 // assert(0);
226 }
227 }
229 anti_spam_enable_ = message[kNIMMsgKeyAntiSpamEnable].asInt() == 1 ? BS_TRUE : BS_FALSE;
230 anti_spam_content_ = message[kNIMMsgKeyAntiSpamContent].asString();
232 client_anti_spam_hitting_ = message[kNIMMsgKeyClientAntiSpam].asInt() == 1 ? BS_TRUE : BS_FALSE;
233 if (message.isMember(kNIMMsgKeyTeamMsgAck))
234 team_msg_need_ack_ = message[kNIMMsgKeyTeamMsgAck].asInt() == 1 ? BS_TRUE : BS_FALSE;
236 team_msg_ack_sent_ = message[kNIMMsgKeyLocalKeyTeamMsgAckSent].asInt() == 1 ? BS_TRUE : BS_FALSE;
238 team_msg_unread_count_ = message[kNIMMsgKeyLocalKeyTeamMsgUnreadCount].asInt();
240 is_update_session_ = message[kNIMMsgKeyIsUpdateSession].asBool() ? BS_TRUE : BS_FALSE;
242 yidun_anti_cheating_ = message[kNIMMsgKeyAntiCheatingYiDun].asString();
243 if (message.isMember(kNIMMsgKeyAntiSpamExt))
244 anti_spam_ext = message[kNIMMsgKeyAntiSpamExt].asString();
245 if (message.isMember(kNIMMsgKeyAntiSpamRes))
246 anti_spam_res = message[kNIMMsgKeyAntiSpamRes].asString();
247 if (message.isMember(kNIMMsgKeyEnv))
248 env_config_ = message[kNIMMsgKeyEnv].asString();
249 }
250};
251
259 uint64_t reply_msg_time_{0};
261 uint64_t reply_msg_id_server_{0};
264
270 uint64_t thread_msg_time_{0};
272 uint64_t thread_msg_id_server_{0};
278 : reply_msg_from_account_("")
279 , reply_msg_to_account_("")
280 , reply_msg_time_(0)
281 , reply_msg_id_server_(0)
282 , reply_msg_id_client_("")
283 , thread_msg_from_account_("")
284 , thread_msg_to_account_("")
285 , thread_msg_time_(0)
286 , thread_msg_id_server_(0)
287 , thread_msg_id_client_("")
288 , deleted_(0) {}
289};
290
293 // 机器人 function
294 std::string function_;
295 // 机器人消息 topic
296 std::string topic_;
297 // 机器人自定义字段
298 std::string custom_content_;
299 // 机器人账号, 单聊忽略, 群聊需指定
300 std::string account_;
301};
302
306 std::string account_id_;
310 message[kNIMMsgAIConfig][kNIMAICallKeyAccountID] = account_id_;
311 message[kNIMMsgAIConfig][kNIMAICallKeyStatus] = ai_status_;
312 }
315 ToJsonValue(value);
316 return value;
317 }
318};
319
322
327 ai_config_.ToJsonValue(ai_config);
328 message_value[kNIMMsgAIConfig] = ai_config;
329 }
332 ToJsonValue(value);
333 return value;
334 }
335};
336
338
347 std::string receiver_accid_;
349 std::string sender_accid_;
351 int64_t timetag_;
353 std::string content_;
357 std::string attach_;
359 std::string client_msg_id_;
365 int32_t sub_type_{0};
367 std::string local_res_path_;
369 std::string local_talk_id_;
371 std::string local_res_id_;
390
393 : rescode_((NIMResCode)0)
394 , feature_(kNIMMessageFeatureDefault)
395 , readonly_sender_client_type_(kNIMClientTypeDefault)
396 , readonly_server_id_(0)
397 , session_type_(kNIMSessionTypeP2P)
398 , timetag_(0)
400 , status_(nim::kNIMMsgLogStatusNone)
401 , sub_status_(nim::kNIMMsgLogSubStatusNone) {}
402
404 IMMessage(const std::string& json_msg)
405 : rescode_((NIMResCode)0)
406 , feature_(kNIMMessageFeatureDefault)
407 , readonly_sender_client_type_(kNIMClientTypeDefault)
408 , readonly_server_id_(0)
409 , session_type_(kNIMSessionTypeP2P)
410 , timetag_(0)
412 , status_(nim::kNIMMsgLogStatusNone)
413 , sub_status_(nim::kNIMMsgLogSubStatusNone) {
415 if (nim::ParseJsonValue(json_msg, values) && values.isObject()) {
416 session_type_ = (NIMSessionType)values[kNIMMsgKeyToType].asUInt();
417 receiver_accid_ = values[kNIMMsgKeyToAccount].asString();
418 sender_accid_ = values[kNIMMsgKeyFromAccount].asString();
419 readonly_sender_client_type_ = (NIMClientType)values[kNIMMsgKeyFromClientType].asUInt();
420 readonly_sender_device_id_ = values[kNIMMsgKeyFromDeviceId].asString();
421 readonly_sender_nickname_ = values[kNIMMsgKeyFromNick].asString();
422 timetag_ = values[kNIMMsgKeyTime].asUInt64();
423 type_ = (NIMMessageType)values[kNIMMsgKeyType].asUInt();
424 content_ = values[kNIMMsgKeyBody].asString();
425 attach_ = values[kNIMMsgKeyAttach].asString();
426 client_msg_id_ = values[kNIMMsgKeyClientMsgid].asString();
427 readonly_server_id_ = values[kNIMMsgKeyServerMsgid].asUInt64();
428 local_res_path_ = values[kNIMMsgKeyLocalFilePath].asString();
429 local_talk_id_ = values[kNIMMsgKeyLocalTalkId].asString();
430 local_res_id_ = values[kNIMMsgKeyLocalResId].asString();
431 status_ = (NIMMsgLogStatus)values[kNIMMsgKeyLocalLogStatus].asUInt();
432 sub_status_ = (NIMMsgLogSubStatus)values[kNIMMsgKeyLocalLogSubStatus].asUInt();
433 msg_setting_.ParseMessageSetting(values);
434 // v7.8 <--
435 third_party_callback_ext_ = values[kNIMMsgKeyThirdPartyCBEXT].asString();
436 sub_type_ = values[kNIMMsgKeySubType].asInt();
437 // --> v7.8
438 if (values.isMember(kNIMMsgKeyThreadInfo)) {
449 thread_info_.deleted_ = values[kNIMMsgKeyThreadInfo][kNIMMsgKeyDeleted].asInt();
450 }
451 if (values.isMember(kNIMMsgKeyRobotInfo)) {
456 }
457 if (values.isMember(kNIMMsgAIConfig) && values[kNIMMsgAIConfig].isObject()) {
458 const auto& ai_config = values[kNIMMsgAIConfig];
459 if (ai_config.isMember(kNIMAICallKeyAccountID) && ai_config[kNIMAICallKeyAccountID].isString())
460 ai_config_.account_id_ = ai_config[kNIMAICallKeyAccountID].asString();
461 if (ai_config.isMember(kNIMAICallKeyStatus) && ai_config[kNIMAICallKeyStatus].isInt())
462 ai_config_.ai_status_ = static_cast<NIMAIMessageStatus>(ai_config[kNIMAICallKeyStatus].asInt());
463 }
464 }
465 }
466
473 values[kNIMMsgKeyLocalRescode] = rescode_;
474 values[kNIMMsgKeyToType] = session_type_;
475 values[kNIMMsgKeyToAccount] = receiver_accid_;
476 values[kNIMMsgKeyFromAccount] = sender_accid_;
477 values[kNIMMsgKeyTime] = timetag_;
478 values[kNIMMsgKeyType] = type_;
479 values[kNIMMsgKeyBody] = content_;
480 values[kNIMMsgKeyAttach] = attach_;
481 values[kNIMMsgKeyClientMsgid] = client_msg_id_;
482 values[kNIMMsgKeyLocalFilePath] = local_res_path_;
483 values[kNIMMsgKeyLocalTalkId] = local_talk_id_;
484 values[kNIMMsgKeyLocalResId] = local_res_id_;
485 values[kNIMMsgKeyLocalLogStatus] = status_;
486 values[kNIMMsgKeyLocalLogSubStatus] = sub_status_;
487 values[kNIMMsgKeySubType] = sub_type_;
488 msg_setting_.ToJsonValue(values);
489 if (!use_to_send) {
490 values[kNIMMsgKeyFromClientType] = readonly_sender_client_type_;
491 values[kNIMMsgKeyFromDeviceId] = readonly_sender_device_id_;
492 values[kNIMMsgKeyFromNick] = readonly_sender_nickname_;
493 values[kNIMMsgKeyServerMsgid] = readonly_server_id_;
494 values[kNIMMsgKeyThirdPartyCBEXT] = third_party_callback_ext_;
495 }
506 values[kNIMMsgKeyThreadInfo][kNIMMsgKeyDeleted] = thread_info_.deleted_;
508 values[kNIMMsgKeyRobotInfo][kNIMMsgKeyRobotTopic] = robot_info_.topic_;
511 if (!ai_config_.account_id_.empty()) {
513 ai_config[kNIMAICallKeyAccountID] = ai_config_.account_id_;
514 ai_config[kNIMAICallKeyStatus] = ai_config_.ai_status_;
515 values[kNIMMsgAIConfig] = ai_config;
516 }
517 return values;
518 }
519
524 std::string ToJsonString(bool use_to_send) const {
525 nim_cpp_wrapper_util::Json::Value values = ToJsonObject(use_to_send);
526 return GetJsonStringWithNoStyled(values);
527 }
528};
529
533 std::string md5_;
535 int64_t size_;
537 std::string url_;
539 std::string display_name_;
541 std::string file_extension_;
546 : size_(0)
547 , msg_attachment_tag_(kNIMNosDefaultTagIM) {}
548
555 // 以下客户端可以选填
556 if (!display_name_.empty())
557 attach[kNIMFileMsgKeyDisplayName] = display_name_;
558 if (!file_extension_.empty())
559 attach[kNIMFileMsgKeyExt] = file_extension_;
560 if (!md5_.empty())
561 attach[kNIMFileMsgKeyMd5] = md5_;
562 if (size_ > 0)
563 attach[kNIMFileMsgKeySize] = size_;
564 if (!url_.empty())
565 attach[kNIMMsgAttachKeyUrl] = url_;
566 if (!msg_attachment_tag_.empty())
567 attach[kNIMMsgAttachKeyTag] = msg_attachment_tag_;
568 return GetJsonStringWithNoStyled(attach);
569 }
570
575 std::string ToJsonString() const {
577 attach[kNIMFileMsgKeyDisplayName] = display_name_;
578 return ToJsonString(attach);
579 }
580
581 bool operator==(const IMFile& rhs) const {
582 return md5_ == rhs.md5_ && size_ == rhs.size_ && url_ == rhs.url_ && display_name_ == rhs.display_name_ &&
583 file_extension_ == rhs.file_extension_ && msg_attachment_tag_ == rhs.msg_attachment_tag_;
584 }
585};
586
593
596 : width_(0)
597 , height_(0) {}
598
603 std::string ToJsonString() const {
605 attach[kNIMImgMsgKeyWidth] = width_;
606 attach[kNIMImgMsgKeyHeight] = height_;
607
608 return IMFile::ToJsonString(attach); // remove the Visual C++ __super keyword.
609 }
610
611 bool operator==(const IMImage& rhs) const { return IMFile::operator==(rhs) && width_ == rhs.width_ && height_ == rhs.height_; }
612};
613
617 std::string description_;
619 double latitude_;
622
625 : latitude_(0)
626 , longitude_(0) {}
627
632 std::string ToJsonString() const {
634 attach[kNIMLocationMsgKeyTitle] = description_;
635 attach[kNIMLocationMsgKeyLatitude] = latitude_;
636 attach[kNIMLocationMsgKeyLongitude] = longitude_;
637
638 return GetJsonStringWithNoStyled(attach);
639 }
640
641 bool operator==(const IMLocation& rhs) const {
642 return description_ == rhs.description_ && latitude_ == rhs.latitude_ && longitude_ == rhs.longitude_;
643 }
644};
645
650
653 : duration_(0) {}
654
659 std::string ToJsonString() const {
661 attach[kNIMAudioMsgKeyDuration] = duration_;
662
663 return IMFile::ToJsonString(attach); // remove the Visual C++ __super keyword.
664 }
665
666 bool operator==(const IMAudio& rhs) const { return IMFile::operator==(rhs) && duration_ == rhs.duration_; }
667};
668
677
680 : duration_(0)
681 , width_(0)
682 , height_(0) {}
683
688 std::string ToJsonString() const {
690 attach[kNIMVideoMsgKeyWidth] = width_;
691 attach[kNIMVideoMsgKeyHeight] = height_;
692 attach[kNIMVideoMsgKeyDuration] = duration_;
693
694 return IMFile::ToJsonString(attach); // remove the Visual C++ __super keyword.
695 }
696
697 bool operator==(const IMVideo& rhs) const {
698 return IMFile::operator==(rhs) && duration_ == rhs.duration_ && width_ == rhs.width_ && height_ == rhs.height_;
699 }
700};
701
707 std::string robot_accid_;
710
712 std::string related_msg_id_;
714 std::string robot_msg_flag_;
717
720 : out_msg_(false) {}
721
726 std::string ToJsonString() const {
728 attach[kNIMBotRobotMsgKeyRobotID] = robot_accid_;
729 attach[kNIMBotRobotSentMsgKeyParam] = sent_param_;
730 attach[kNIMBotRobotReceivedMsgKeyMsgOut] = out_msg_;
731 attach[kNIMBotRobotReceivedMsgKeyClientMsgID] = related_msg_id_;
732 attach[kNIMBotRobotReceivedMsgKeyRobotMsgFlag] = robot_msg_flag_;
733 attach[kNIMBotRobotReceivedMsgKeyRobotMsgMessage] = robot_msg_content_;
734
735 return GetJsonStringWithNoStyled(attach);
736 }
737
738 bool operator==(const IMBotRobot& rhs) const {
739 return out_msg_ == rhs.out_msg_ && robot_accid_ == rhs.robot_accid_ && sent_param_ == rhs.sent_param_ &&
740 related_msg_id_ == rhs.related_msg_id_ && robot_msg_flag_ == rhs.robot_msg_flag_ && robot_msg_content_ == rhs.robot_msg_content_;
741 }
742};
743
746 std::string body_;
747 int64_t time_;
748 int64_t id_;
749 std::string from_id_;
750};
751
758NIM_SDK_CPPWRAPPER_DLL_API bool ParseMessage(const std::string& msg_json, IMMessage& message);
759
766NIM_SDK_CPPWRAPPER_DLL_API bool ParseReceiveMessage(const std::string& msg_json, IMMessage& message);
767
775
783
784} // namespace nim
785
786#endif //_NIM_SDK_CPP_TALK_HELPER_H_
Represents a JSON value.
Definition value.h:196
bool isMember(const char *key) const
Definition json_value.cpp:1241
bool isArray() const
Definition json_value.cpp:1386
bool isObject() const
Definition json_value.cpp:1390
bool asBool() const
Definition json_value.cpp:839
bool empty() const
Return true if empty array, empty object, or null; otherwise, false.
Definition json_value.cpp:908
Int asInt() const
Definition json_value.cpp:657
String asString() const
Embedded zeroes are possible.
Definition json_value.cpp:632
namespace nim
bool ParseMessage(const std::string &msg_json, IMMessage &message)
解析消息
Definition nim_talk_helper.cpp:11
bool ParseJsonValue(const std::string &content, nim_cpp_wrapper_util::Json::Value &values)
解析JsonString
Definition nim_json_util.cpp:70
bool StrListToJsonString(const std::list< std::string > &list, std::string &out)
将一个string类型的list组装成一个Json Array
Definition nim_json_util.cpp:12
bool ParseReceiveMessage(const std::string &msg_json, IMMessage &message)
解析消息
Definition nim_talk_helper.cpp:20
bool JsonStrArrayToList(const nim_cpp_wrapper_util::Json::Value &array_str, std::list< std::string > &out)
将一个string类型的Json Array解析成一个string类型的list
Definition nim_json_util.cpp:30
std::string GetJsonStringWithNoStyled(const nim_cpp_wrapper_util::Json::Value &values)
获得非格式化的Json string,传入SDK的json string格式要求为非格式化的,如果是格式化的json string可能会影响功能
Definition nim_json_util.cpp:89
static const char * kNIMAICallKeyStatus
int AI config status
Definition nim_ai_def.h:15
static const char * kNIMAICallKeyAccountID
string AI account id
Definition nim_ai_def.h:11
AI 辅助方法和数据结构定义
NIMClientType
Definition nim_client_def.h:113
@ kNIMClientTypeDefault
Default, unset
Definition nim_client_def.h:115
NIM 公共数据类型定义总的包含文件
JSON辅助方法
NIMMsgLogStatus
Definition nim_msglog_def.h:343
@ kNIMMsgLogStatusNone
默认,不能当查询条件,意义太多
Definition nim_msglog_def.h:345
NIMMessageType
Definition nim_msglog_def.h:301
@ kNIMMessageTypeUnknown
未知类型消息,本地使用,发送时勿使用,作为默认值
Definition nim_msglog_def.h:325
NIMAIMessageStatus
AI 数字人消息状态
Definition nim_msglog_def.h:529
@ kNIMMessageAIStatusUnknown
默认
Definition nim_msglog_def.h:531
NIMMsgLogSubStatus
Definition nim_msglog_def.h:465
@ kNIMMsgLogSubStatusNone
默认状态
Definition nim_msglog_def.h:467
NIMMessageFeature
Definition nim_msglog_def.h:329
@ kNIMMessageFeatureDefault
默认
Definition nim_msglog_def.h:331
static const char * kNIMNosDefaultTagIM
string im消息类文件上传tag 如图片、文件、音视频消息等, 可以通过 nim_nos_init_tags修改资源的过期时间
Definition nim_nos_def.h:203
定义导出宏
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition nim_sdk_cpp_wrapper.h:38
加载 NIM SDK 的帮助类头文件
BoolStatus
Definition nim_sdk_util.h:22
@ BS_TRUE
true
Definition nim_sdk_util.h:28
@ BS_NOT_INIT
未初始化
Definition nim_sdk_util.h:24
@ BS_FALSE
false
Definition nim_sdk_util.h:26
NIMSessionType
Definition nim_session_def.h:16
@ kNIMSessionTypeP2P
个人,即点对点
Definition nim_session_def.h:18
static const char * kNIMMsgKeyRobotFunction
(可选)string, 机器人 function,后台配置
Definition nim_talk_def.h:244
static const char * kNIMMsgKeyAttach
string,消息多媒体资源参数,不同类型多媒体参数不同,发送非多媒体消息时不需要填写,如需使用json string,必须为可以解析为json的非格式化的字符串
Definition nim_talk_def.h:156
static const char * kNIMMsgKeyRobotCustomContent
(可选)string, 机器人消息的自定义字段,后台配置
Definition nim_talk_def.h:248
static const char * kNIMLocationMsgKeyLatitude
double,纬度
Definition nim_talk_def.h:408
static const char * kNIMMsgKeyFromDeviceId
string,消息发送方设备id,服务器填写,发送方不需要填写
Definition nim_talk_def.h:146
static const char * kNIMMsgKeyReplyMsgToAccount
(可选)string,从属thread_info节点,被回复消息的消息接受者,群的话是tid
Definition nim_talk_def.h:224
static const char * kNIMMsgKeyThreadInfo
(可选) json object,被回复消息的消息发送者
Definition nim_talk_def.h:220
static const char * kNIMMsgKeyLocalRescode
int,消息错误码(NIMResCode)
Definition nim_talk_def.h:124
static const char * kNIMMsgKeyAntiSpamUsingYiDun
int, (可选) 单条消息是否使用易盾反垃圾 0:(在开通易盾的情况下)不过易盾反垃圾
Definition nim_talk_def.h:205
static const char * kNIMMsgKeyReplyMsgIdClient
(可选)string,从属thread_info节点,被回复消息的消息ID)clientId)
Definition nim_talk_def.h:230
static const char * kNIMMsgKeyToType
int,会话类型(NIMSessionType)
Definition nim_talk_def.h:138
static const char * kNIMMsgKeyThreadMsgIdServer
(可选)long,从属thread_info节点,thread消息的消息ID)serverId)
Definition nim_talk_def.h:238
static const char * kNIMBotRobotReceivedMsgKeyClientMsgID
string,机器人回复时带的字段,表示该条回复相关联的消息ID
Definition nim_talk_def.h:423
static const char * kNIMMsgKeyIsForcePush
int,(可选)群组消息是否强推,0:不强推, 1:强推,属性只针对群组消息强推列表
Definition nim_talk_def.h:192
static const char * kNIMMsgKeyLocalTalkId
string,会话id,发送方选填,接收方收到的是消息发送方id
Definition nim_talk_def.h:271
static const char * kNIMMsgKeyDeleted
Definition nim_talk_def.h:253
static const char * kNIMMsgKeyAntiCheatingYiDun
(可选)String, 易盾反垃圾增强反作弊专属字段, 限制json,长度限制1024
Definition nim_talk_def.h:211
static const char * kNIMMsgKeyClientAntiSpam
int, (可选) 是否命中客户端反垃圾,命中:1 未命中:0 或者不填写
Definition nim_talk_def.h:199
static const char * kNIMMsgKeyBody
string,消息正文,长度限制:5000字符
Definition nim_talk_def.h:154
static const char * kNIMMsgKeyClientMsgid
string,客户端消息id
Definition nim_talk_def.h:158
static const char * kNIMLocationMsgKeyLongitude
double,经度
Definition nim_talk_def.h:410
static const char * kNIMMsgKeyType
int,消息类型(NIMMessageType)
Definition nim_talk_def.h:152
static const char * kNIMMsgKeyRobotAccount
(可选)string, 机器人账号,单聊里不需要填;群聊里需要指定机器人账号,机器人回复的消息里也会带上这字段
Definition nim_talk_def.h:250
static const char * kNIMBotRobotReceivedMsgKeyRobotMsgFlag
string,机器人回复时带的字段,表示该条回复类型,类型定义可见Demo源码或参考波特开发文档,bot或faq
Definition nim_talk_def.h:429
static const char * kNIMFileMsgKeyDisplayName
string,用于显示的文件名,发送方选填,默认文件名
Definition nim_talk_def.h:397
static const char * kNIMMsgKeyEnv
Definition nim_talk_def.h:261
static const char * kNIMMsgKeyLocalKeyTeamMsgUnreadCount
int, 群消息未读数
Definition nim_talk_def.h:267
static const char * kNIMMsgKeyLocalExt
string,只维护在本地的扩展字段,必须为可以解析为json的非格式化的字符串
Definition nim_talk_def.h:279
static const char * kNIMMsgKeyAntiSpamBizId
string, (可选)用户配置的对某些单条消息另外的反垃圾的业务ID
Definition nim_talk_def.h:203
static const char * kNIMMsgKeyTeamMsgAck
(可选)int, 群消息是否需要已读业务,0:不需要,1:需要
Definition nim_talk_def.h:207
static const char * kNIMMsgKeyMsgRoutable
int,(可选)该消息是否抄送,0:不支持,1:支持,默认按照app的路由开关
Definition nim_talk_def.h:182
static const char * kNIMMsgKeyReplyMsgFromAccount
(可选)string,从属thread_info节点,被回复消息的消息发送者
Definition nim_talk_def.h:222
static const char * kNIMMsgKeyForcePushList
string,(可选)群组消息强推列表,推送指定账号id string array json, 如果推送全员不填
Definition nim_talk_def.h:188
static const char * kNIMMsgKeyServerExt
string,(可选)自定义扩展字段,必须为可以解析为json的非格式化的字符串,长度限制1024
Definition nim_talk_def.h:172
static const char * kNIMMsgKeyRobotTopic
(可选)string, 机器人消息的 topic,后台配置
Definition nim_talk_def.h:246
static const char * kNIMMsgKeySetMsgOffline
int,(可选)消息是否要存离线,0:不需要, 1:需要,默认1
Definition nim_talk_def.h:186
static const char * kNIMMsgKeyMsgSync
int,(可选)该消息是否支持发送者多端同步,可选,0:不支持,1:支持, 默认1
Definition nim_talk_def.h:168
static const char * kNIMBotRobotMsgKeyRobotID
string,机器人云信ID
Definition nim_talk_def.h:419
static const char * kNIMMsgAIConfig
string AI config
Definition nim_talk_def.h:291
static const char * kNIMVideoMsgKeyDuration
int,短视频资源时间长度(毫秒),发送方必填
Definition nim_talk_def.h:378
static const char * kNIMFileMsgKeyMd5
string,资源MD5,发送方选填
Definition nim_talk_def.h:393
static const char * kNIMMsgKeyFromClientType
int,消息发送方客户端类型(NIMClientType),服务器填写,发送方不需要填写
Definition nim_talk_def.h:144
static const char * kNIMVideoMsgKeyHeight
int,短视频画面高度,发送方必填
Definition nim_talk_def.h:382
static const char * kNIMVideoMsgKeyWidth
int,短视频画面宽度,发送方必填
Definition nim_talk_def.h:380
static const char * kNIMMsgKeyIsBlacklisted
int,(可选)该消息被黑名单拦截 0:未被拦截,1:被拦截
Definition nim_talk_def.h:184
static const char * kNIMMsgKeyFromAccount
string,消息发送方id,服务器填写,发送方不需要填写
Definition nim_talk_def.h:142
static const char * kNIMBotRobotReceivedMsgKeyRobotMsgMessage
json object,机器人回复时带的字段,表示该条回复内容,字段内容定义可见Demo源码或参考波特开发文档
Definition nim_talk_def.h:431
static const char * kNIMMsgKeyIsUpdateSession
(可选)bool, 消息是否需要刷新到session服务,false:否,true:是;只有消息存离线的情况下,才会判断该参数,缺省:true
Definition nim_talk_def.h:209
static const char * kNIMMsgKeyServerMsgid
long,服务器端消息id
Definition nim_talk_def.h:160
static const char * kNIMImgMsgKeyHeight
int,图片高度,发送方必填
Definition nim_talk_def.h:342
static const char * kNIMMsgKeyAntiSpamEnable
int, 是否需要过易盾反垃圾, 0:不需要,1:需要, 默认0
Definition nim_talk_def.h:194
static const char * kNIMMsgKeyFromNick
string,消息发送方昵称,服务器填写,发送方不需要填写
Definition nim_talk_def.h:148
static const char * kNIMMsgKeyMsgRoaming
int,(可选)该消息是否支持漫游,可选,0:不支持,1:支持, 默认1
Definition nim_talk_def.h:166
static const char * kNIMMsgKeyLocalFilePath
string,多媒体消息资源本地绝对路径,SDK本地维护,发送多媒体消息时必填
Definition nim_talk_def.h:269
static const char * kNIMMsgKeyPushNeedPrefix
int,(可选)推送是否需要前缀,0:不需要,1:需要,默认1
Definition nim_talk_def.h:180
static const char * kNIMLocationMsgKeyTitle
string,位置信息
Definition nim_talk_def.h:412
static const char * kNIMMsgKeyReplyMsgIdServer
(可选)long,从属thread_info节点,被回复消息的消息ID)serverId)
Definition nim_talk_def.h:228
static const char * kNIMMsgKeyThreadMsgTime
(可选)long,从属thread_info节点,thread消息的消息发送时间
Definition nim_talk_def.h:236
static const char * kNIMMsgKeyResendFlag
int,消息重发标记位,第一次发送0,重发1
Definition nim_talk_def.h:162
static const char * kNIMFileMsgKeySize
long,资源大小(KB),发送方选填
Definition nim_talk_def.h:395
static const char * kNIMMsgKeyLocalResId
string,多媒体资源id,发送方选填,接收方收到的是客户端消息id
Definition nim_talk_def.h:273
static const char * kNIMMsgKeyLocalKeyTeamMsgAckSent
bool 是否已经发送群消息已读回执
Definition nim_talk_def.h:265
static const char * kNIMMsgKeyThreadMsgIdClient
(可选)string,从属thread_info节点,thread消息的消息ID)clientId)
Definition nim_talk_def.h:240
static const char * kNIMMsgKeyToAccount
string,消息接收方id,给自己发送消息时填写自己id
Definition nim_talk_def.h:140
static const char * kNIMMsgKeyLocalLogSubStatus
int,消息二级状态(NIMMsgLogSubStatus)
Definition nim_talk_def.h:277
static const char * kNIMImgMsgKeyWidth
int,图片宽度,发送方必填
Definition nim_talk_def.h:340
static const char * kNIMAudioMsgKeyDuration
int,语音资源时间长度(毫秒),发送方必填
Definition nim_talk_def.h:359
static const char * kNIMMsgKeyPushNeedBadge
int,(可选)推送是否要做消息计数(角标),0:不需要,1:需要,默认1
Definition nim_talk_def.h:170
static const char * kNIMMsgKeyThreadMsgFromAccount
(可选)string,从属thread_info节点,thread消息的消息发送者
Definition nim_talk_def.h:232
static const char * kNIMMsgKeyPushEnable
int,(可选)是否需要推送, 0:不需要,1:需要,默认1,aos在收到0是不要模拟本地推送
Definition nim_talk_def.h:178
static const char * kNIMMsgKeyForcePushContent
string,(可选)群组消息强推文本
Definition nim_talk_def.h:190
static const char * kNIMBotRobotSentMsgKeyParam
json string,给机器人发送时需要填的字段,字段内容定义可见Demo源码或参考波特开发文档
Definition nim_talk_def.h:421
static const char * kNIMMsgKeyAntiSpamContent
Definition nim_talk_def.h:197
static const char * kNIMMsgKeyTime
long,消息时间戳(毫秒)
Definition nim_talk_def.h:150
static const char * kNIMMsgAttachKeyUrl
long,资源URL, 发送方不需要填写
Definition nim_talk_def.h:323
static const char * kNIMMsgKeyPushContent
string,(可选)自定义推送文案,长度限制200字节
Definition nim_talk_def.h:176
static const char * kNIMMsgKeyThreadMsgToAccount
(可选)string,t从属thread_info节点,hread消息的消息接受者,群的话是tid
Definition nim_talk_def.h:234
static const char * kNIMBotRobotReceivedMsgKeyMsgOut
bool,是否为机器人回复,默认为true
Definition nim_talk_def.h:425
static const char * kNIMMsgKeyReplyMsgTime
(可选)long,从属thread_info节点,被回复消息的消息发送时间
Definition nim_talk_def.h:226
static const char * kNIMMsgKeyPushPayload
string,(可选)第三方自定义的推送属性,必须为可以解析为json的非格式化的字符串,长度2048
Definition nim_talk_def.h:174
static const char * kNIMMsgKeyLocalLogStatus
int,消息状态(NIMMsgLogStatus)
Definition nim_talk_def.h:275
static const char * kNIMMsgKeyHistorySave
int,(可选)该消息是否存储云端历史,可选,0:不支持,1:支持, 默认1
Definition nim_talk_def.h:164
static const char * kNIMMsgAttachKeyTag
string, (可选)发送含有附件的消息时使用的场景标签(可参见nos删除策略) ,Audio Image Video File 或者可以被SDK解析到本地文件路径的自定义消息
Definition nim_talk_def.h:329
static const char * kNIMMsgKeySubType
(可选)int,消息的子类型,客户端定义,服务器透传
Definition nim_talk_def.h:258
static const char * kNIMMsgKeyAntiSpamExt
(可选)String, 易盾反垃圾扩展字段,限制json,长度限制1024
Definition nim_talk_def.h:213
static const char * kNIMMsgKeyThirdPartyCBEXT
(可选)string第三方回调回来的自定义扩展字段
Definition nim_talk_def.h:256
static const char * kNIMFileMsgKeyExt
string,资源扩展名,不包括符号'.',发送方若选填需要保证资源本地路径包含扩展名
Definition nim_talk_def.h:401
static const char * kNIMMsgKeyAntiSpamRes
String, 易盾反垃圾返回的结果字段
Definition nim_talk_def.h:215
static const char * kNIMMsgKeyRobotInfo
Definition nim_talk_def.h:242
NIMResCode
Definition public_defines.h:21
#define false
Definition stdbool.h:33
Definition nim_talk_helper.h:745
std::string body_
Definition nim_talk_helper.h:746
int64_t id_
Definition nim_talk_helper.h:748
std::string from_id_
Definition nim_talk_helper.h:749
int64_t time_
Definition nim_talk_helper.h:747
语音消息附件
Definition nim_talk_helper.h:647
int duration_
语音时长
Definition nim_talk_helper.h:649
std::string ToJsonString() const
组装Json Value字符串
Definition nim_talk_helper.h:659
IMAudio()
Definition nim_talk_helper.h:652
bool operator==(const IMAudio &rhs) const
Definition nim_talk_helper.h:666
波特机器人消息附件
Definition nim_talk_helper.h:703
std::string related_msg_id_
机器人回复时带的字段,表示该条回复相关联的消息ID
Definition nim_talk_helper.h:712
nim_cpp_wrapper_util::Json::Value robot_msg_content_
机器人回复时带的字段,表示该条回复内容,字段内容定义可见Demo源码或参考波特开发文档
Definition nim_talk_helper.h:716
bool out_msg_
是否为机器人回复,是:true,不是:false,默认false
Definition nim_talk_helper.h:705
bool operator==(const IMBotRobot &rhs) const
Definition nim_talk_helper.h:738
nim_cpp_wrapper_util::Json::Value sent_param_
给机器人发送时需要填的字段,字段内容定义可见Demo源码或参考波特开发文档
Definition nim_talk_helper.h:709
std::string ToJsonString() const
组装Json Value字符串
Definition nim_talk_helper.h:726
IMBotRobot()
Definition nim_talk_helper.h:719
std::string robot_accid_
机器人云信ID
Definition nim_talk_helper.h:707
std::string robot_msg_flag_
机器人回复时带的字段,表示该条回复类型,类型定义可见Demo源码或参考波特开发文档
Definition nim_talk_helper.h:714
文件消息附件
Definition nim_talk_helper.h:531
std::string md5_
文件内容MD5
Definition nim_talk_helper.h:533
std::string display_name_
用于显示的文件名称
Definition nim_talk_helper.h:539
IMFile()
Definition nim_talk_helper.h:545
std::string url_
上传云端后得到的文件下载地址
Definition nim_talk_helper.h:537
std::string file_extension_
文件扩展名
Definition nim_talk_helper.h:541
std::string ToJsonString(nim_cpp_wrapper_util::Json::Value &attach) const
组装Json Value字符串
Definition nim_talk_helper.h:554
std::string ToJsonString() const
组装Json Value字符串
Definition nim_talk_helper.h:575
int64_t size_
文件大小
Definition nim_talk_helper.h:535
std::string msg_attachment_tag_
string, (可选)发送含有附件的消息时使用的场景标签(可参见nos删除策略) Audio Image Video File或者可以被SDK解析到本地文件路径的自定义消息
Definition nim_talk_helper.h:543
bool operator==(const IMFile &rhs) const
Definition nim_talk_helper.h:581
图片消息附件
Definition nim_talk_helper.h:588
bool operator==(const IMImage &rhs) const
Definition nim_talk_helper.h:611
std::string ToJsonString() const
组装Json Value字符串
Definition nim_talk_helper.h:603
int height_
图片高度
Definition nim_talk_helper.h:592
IMImage()
Definition nim_talk_helper.h:595
int width_
图片宽度
Definition nim_talk_helper.h:590
位置消息附件
Definition nim_talk_helper.h:615
double latitude_
位置纬度
Definition nim_talk_helper.h:619
double longitude_
位置经度
Definition nim_talk_helper.h:621
bool operator==(const IMLocation &rhs) const
Definition nim_talk_helper.h:641
std::string description_
位置描述内容
Definition nim_talk_helper.h:617
std::string ToJsonString() const
组装Json Value字符串
Definition nim_talk_helper.h:632
IMLocation()
Definition nim_talk_helper.h:624
AI 数字人消息信息
Definition nim_talk_helper.h:304
std::string account_id_
数字人账号信息,发送消息时指定该字段代表要 @ AI 数字人
Definition nim_talk_helper.h:306
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &message) const
Definition nim_talk_helper.h:309
NIMAIMessageStatus ai_status_
数字人消息状态
Definition nim_talk_helper.h:308
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
Definition nim_talk_helper.h:313
Definition nim_talk_helper.h:339
std::string local_res_path_
媒体文件本地绝对路径(客户端)
Definition nim_talk_helper.h:367
std::string ToJsonString(bool use_to_send) const
组装Json Value字符串
Definition nim_talk_helper.h:524
IMMessageAIConfig ai_config_
AI 数字人消息配置
Definition nim_talk_helper.h:381
NIMSessionType session_type_
会话类型
Definition nim_talk_helper.h:345
NIMMessageFeature feature_
消息属性
Definition nim_talk_helper.h:343
MessageSetting msg_setting_
消息属性设置
Definition nim_talk_helper.h:361
IMMessage(const std::string &json_msg)
Definition nim_talk_helper.h:404
std::string readonly_sender_device_id_
发送者客户端设备ID(只读)
Definition nim_talk_helper.h:385
NIMClientType readonly_sender_client_type_
发送者客户端类型(只读)
Definition nim_talk_helper.h:383
std::string client_msg_id_
消息ID(客户端)
Definition nim_talk_helper.h:359
std::string receiver_accid_
接收者ID
Definition nim_talk_helper.h:347
IMMessage()
Definition nim_talk_helper.h:392
NIMResCode rescode_
错误码
Definition nim_talk_helper.h:341
NIMMsgLogStatus status_
消息状态(客户端)
Definition nim_talk_helper.h:373
std::string local_talk_id_
会话ID(客户端)
Definition nim_talk_helper.h:369
IMMessageThreadInfo thread_info_
thread 消息信息
Definition nim_talk_helper.h:377
nim_cpp_wrapper_util::Json::Value ToJsonObject(bool use_to_send) const
组装Json Object
Definition nim_talk_helper.h:471
uint64_t readonly_server_id_
消息ID(服务器,只读)
Definition nim_talk_helper.h:389
std::string readonly_sender_nickname_
发送者昵称(只读)
Definition nim_talk_helper.h:387
NIMMsgLogSubStatus sub_status_
消息子状态(客户端)
Definition nim_talk_helper.h:375
NIMMessageType type_
消息类型
Definition nim_talk_helper.h:355
std::string attach_
消息附件 ,长度限制10000
Definition nim_talk_helper.h:357
int64_t timetag_
消息时间戳(毫秒)
Definition nim_talk_helper.h:351
std::string local_res_id_
媒体文件ID(客户端)
Definition nim_talk_helper.h:371
std::string content_
消息内容,长度限制10000
Definition nim_talk_helper.h:353
std::string third_party_callback_ext_
第三方回调回来的自定义扩展字段 v7.8添加
Definition nim_talk_helper.h:363
IMMessageRobotInfo robot_info_
机器人消息信息
Definition nim_talk_helper.h:379
std::string sender_accid_
发送者ID
Definition nim_talk_helper.h:349
机器人消息信息
Definition nim_talk_helper.h:292
std::string topic_
Definition nim_talk_helper.h:296
std::string function_
Definition nim_talk_helper.h:294
std::string account_
Definition nim_talk_helper.h:300
std::string custom_content_
Definition nim_talk_helper.h:298
Definition nim_talk_helper.h:323
IMMessageAIConfigParam ai_config_
Definition nim_talk_helper.h:324
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
Definition nim_talk_helper.h:330
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &message_value) const
Definition nim_talk_helper.h:325
P2P和群组消息
Definition nim_talk_helper.h:253
std::string thread_msg_from_account_
thread消息的消息发送者
Definition nim_talk_helper.h:266
uint64_t thread_msg_time_
thread消息的消息发送时间
Definition nim_talk_helper.h:270
uint64_t thread_msg_id_server_
thread消息的消息ID(serverId)
Definition nim_talk_helper.h:272
std::string thread_msg_id_client_
thread消息的消息ID(clientId)
Definition nim_talk_helper.h:274
std::string reply_msg_from_account_
被回复消息的消息发送者
Definition nim_talk_helper.h:255
std::string thread_msg_to_account_
thread消息的消息接受者,群的话是tid
Definition nim_talk_helper.h:268
IMMessageThreadInfo()
Definition nim_talk_helper.h:277
uint64_t reply_msg_time_
被回复消息的消息发送时间
Definition nim_talk_helper.h:259
uint64_t reply_msg_id_server_
被回复消息的消息ID(serverId)
Definition nim_talk_helper.h:261
int deleted_
消息是否已经被删除(可能是撤回,也可能是单向删除),查询thread消息历史时可能会有这个字段,大于0表示已经删除(目前撤回和单向删除都是1,未来可能区分)
Definition nim_talk_helper.h:276
std::string reply_msg_id_client_
被回复消息的消息ID(clientId)
Definition nim_talk_helper.h:263
std::string reply_msg_to_account_
被回复消息的消息接受者,群的话是tid
Definition nim_talk_helper.h:257
小视频消息附件
Definition nim_talk_helper.h:670
std::string ToJsonString() const
组装Json Value字符串
Definition nim_talk_helper.h:688
int height_
视频画面高度
Definition nim_talk_helper.h:676
int duration_
视频时长
Definition nim_talk_helper.h:672
int width_
视频画面宽度
Definition nim_talk_helper.h:674
IMVideo()
Definition nim_talk_helper.h:679
bool operator==(const IMVideo &rhs) const
Definition nim_talk_helper.h:697
消息属性设置
Definition nim_talk_helper.h:25
nim_cpp_wrapper_util::Json::Value push_payload_
第三方自定义的推送属性,长度2048
Definition nim_talk_helper.h:47
std::string anti_spam_ext
(可选)String, 易盾反垃圾扩展字段,限制 json,长度限制 1024
Definition nim_talk_helper.h:83
std::string anti_apam_biz_id_
(可选)用户配置的对某些单条消息另外的反垃圾的业务ID
Definition nim_talk_helper.h:65
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
Definition nim_talk_helper.h:177
void ParseMessageSetting(const nim_cpp_wrapper_util::Json::Value &message)
从Json Value解析出消息属性设置
Definition nim_talk_helper.h:188
BoolStatus team_msg_need_ack_
群消息是否需要已读业务,0:不需要,1:需要
Definition nim_talk_helper.h:71
std::string force_push_content_
群组消息强推文本
Definition nim_talk_helper.h:59
BoolStatus push_need_prefix_
需要推送昵称
Definition nim_talk_helper.h:39
BoolStatus is_force_push_
群组消息强推开关,强推全员设置true并强推列表为空
Definition nim_talk_helper.h:55
int anti_apam_using_yidun_
int, (可选) 单条消息是否使用易盾反垃圾 0:(在开通易盾的情况下)不过易盾反垃圾
Definition nim_talk_helper.h:67
BoolStatus client_anti_spam_hitting_
(可选) 是否命中客户端反垃圾
Definition nim_talk_helper.h:69
std::string yidun_anti_cheating_
(可选)String, 易盾反垃圾增强反作弊专属字段, 限制json,长度限制1024
Definition nim_talk_helper.h:79
std::string push_content_
自定义推送文案,长度限制200字节
Definition nim_talk_helper.h:49
BoolStatus anti_spam_enable_
是否需要过易盾反垃圾
Definition nim_talk_helper.h:61
std::string anti_spam_res
String, 易盾反垃圾返回的结果字段
Definition nim_talk_helper.h:85
int team_msg_unread_count_
群消息未读数
Definition nim_talk_helper.h:75
BoolStatus self_sync_
该消息是否支持发送者多端同步
Definition nim_talk_helper.h:33
BoolStatus is_update_session_
(可选) 消息是否需要刷新到session服务,0:否,1:是;只有消息存离线的情况下,才会判断该参数,缺省:1
Definition nim_talk_helper.h:77
BoolStatus routable_
是否要抄送
Definition nim_talk_helper.h:41
BoolStatus push_need_badge_
是否要做消息计数
Definition nim_talk_helper.h:37
std::string env_config_
(可选)String, 环境变量,用于指向不同的抄送、第三方回调等配置(于8.0.0添加)
Definition nim_talk_helper.h:81
BoolStatus roaming_
该消息是否支持漫游
Definition nim_talk_helper.h:31
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &message) const
组装Json Value字符串
Definition nim_talk_helper.h:113
std::list< std::string > force_push_ids_list_
群组消息强推列表
Definition nim_talk_helper.h:57
BoolStatus is_blacklisted_
是否被拉黑
Definition nim_talk_helper.h:43
BoolStatus server_history_saved_
该消息是否存储云端历史
Definition nim_talk_helper.h:29
std::string local_ext_
本地扩展字段, 格式不限,长度限制1024
Definition nim_talk_helper.h:53
std::string anti_spam_content_
(可选)开发者自定义的反垃圾字段,长度限制5000
Definition nim_talk_helper.h:63
BoolStatus need_offline_
是否支持离线消息
Definition nim_talk_helper.h:45
BoolStatus need_push_
是否需要推送
Definition nim_talk_helper.h:35
MessageSetting()
Definition nim_talk_helper.h:88
BoolStatus resend_flag_
该消息是否为重发状态
Definition nim_talk_helper.h:27
BoolStatus team_msg_ack_sent_
是否已经发送群消息已读回执
Definition nim_talk_helper.h:73
nim_cpp_wrapper_util::Json::Value server_ext_
第三方扩展字段, 长度限制1024
Definition nim_talk_helper.h:51
Definition nim_ai_helper.h:103
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &values) const
Definition nim_ai_helper.cpp:22