7#ifndef _NIM_SDK_CPP_TALK_HELPER_H_
8#define _NIM_SDK_CPP_TALK_HELPER_H_
101 , anti_apam_using_yidun_(1)
105 , team_msg_unread_count_(-1)
134 if (!push_payload_.
empty())
136 if (!push_content_.empty())
138 if (!server_ext_.
empty())
140 if (!local_ext_.empty())
144 if (!force_push_content_.empty())
146 if (!force_push_ids_list_.empty()) {
147 std::string ids_json;
153 if (!anti_spam_content_.empty())
155 if (!anti_apam_biz_id_.empty())
164 if (team_msg_unread_count_ > -1)
168 if (!yidun_anti_cheating_.empty())
170 if (!anti_spam_ext.empty())
172 if (!anti_spam_res.empty())
174 if (!env_config_.empty())
259 uint64_t reply_msg_time_{0};
261 uint64_t reply_msg_id_server_{0};
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_(
"")
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_(
"")
365 int32_t sub_type_{0};
396 , readonly_server_id_(0)
408 , readonly_server_id_(0)
556 if (!display_name_.empty())
558 if (!file_extension_.empty())
566 if (!msg_attachment_tag_.empty())
578 return ToJsonString(attach);
608 return IMFile::ToJsonString(attach);
663 return IMFile::ToJsonString(attach);
694 return IMFile::ToJsonString(attach);
698 return IMFile::operator==(rhs) && duration_ == rhs.
duration_ && width_ == rhs.
width_ && height_ == rhs.
height_;
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
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
NIMClientType
Definition: nim_client_def.h:113
@ kNIMClientTypeDefault
Default, unset
Definition: nim_client_def.h:115
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
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