NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim::QChatMessageSend结构体 参考

#include <nim_qchat_message_cpp_def.h>

类 nim::QChatMessageSend 继承关系图:
nim::QChatMessage

Public 类型

using AttachRawCreateFunc = std::function< std::shared_ptr< IQChatAttachInterface >(const std::string &)>
 
using AttachCreateFunc = std::function< std::shared_ptr< IQChatAttachInterface >(const NIMQChatMessage &)>
 
using AttachParseFunc = std::function< void(const std::shared_ptr< IQChatAttachInterface > &, NIMQChatMessage &)>
 

Public 成员函数

 QChatMessageSend ()=default
 
 QChatMessageSend (const NIMQChatMessage &c_param)
 
NIMQChatMessage ToCParam () const
 

静态 Public 成员函数

static std::shared_ptr< IQChatAttachInterfaceCreateAttachWithRawData (NIMQChatMsgType type, const std::string &raw_data)
 

Public 属性

uint64_t server_id {0}
 消息所属的server id
 
uint64_t channel_id {0}
 消息所属的channel id
 
NIMQChatMsgType msg_type {kNIMQChatMsgTypeUnknown}
 消息类型
 
uint32_t msg_sub_type {0}
 可选, 消息子类型
 
std::string msg_body {""}
 消息内容
 
std::shared_ptr< IQChatAttachInterfacemsg_attach {std::make_shared<QChatDefaultAttach>()}
 消息附件
 
std::string msg_ext {""}
 消息扩展字段
 
std::string msg_id {""}
 消息重发时需要指定此参数
 
bool resend_flag {false}
 重发标记,false:不是重发,true:是重发
 
bool mention_all {false}
 是否@所有人,false:否,true:是
 
std::vector< std::string > mention_accids {}
 @成员列表
 
std::vector< uint64_t > mention_role_ids {}
 @身份组列表
 
bool history_enable {true}
 该消息是否存储云端历史,0:不支持,1:支持
 
std::string push_payload {""}
 自定义的推送属性,限制json
 
std::string push_content {""}
 自定义的推送内容
 
bool push_enable {false}
 是否需要推送, false: 不需要, true: 需要, 默认 false
 
bool need_badge {true}
 是否需要消息计数, false: 不需要, true: 需要, 默认 true
 
bool need_push_nick {true}
 是否需要推送昵称, false: 不需要, true: 需要, 默认 true
 
bool route_enable {true}
 是否需要抄送, false: 不需要, true: 需要, 默认 true
 
QChatMessageThreadInfo thread_info
 thread 消息相关信息
 
QChatMessageAntiSpamInfo anti_spam_info
 反垃圾信息
 
std::string env
 环境变量
 

静态 Public 属性

static std::map< NIMQChatMsgType, AttachRawCreateFuncattach_raw_create_function_
 

Protected 属性

std::vector< char * > c_mention_accids
 

Private 成员函数

std::shared_ptr< IQChatAttachInterfaceCreateAttach (const NIMQChatMessage &m)
 
void ParseAttach (const std::shared_ptr< IQChatAttachInterface > &p, NIMQChatMessage &cp) const
 

静态 Private 成员函数

template<typename ATTACH_TYPE >
static std::shared_ptr< ATTACH_TYPE > GetOriginAttach (const std::shared_ptr< IQChatAttachInterface > &p)
 

Private 属性

std::map< NIMQChatMsgType, AttachCreateFuncattach_create_functions_
 
std::map< NIMQChatMsgType, AttachParseFuncattach_parse_functions_
 

成员类型定义说明

◆ AttachCreateFunc

using nim::QChatMessageSend::AttachCreateFunc = std::function<std::shared_ptr<IQChatAttachInterface>(const NIMQChatMessage&)>

◆ AttachParseFunc

using nim::QChatMessageSend::AttachParseFunc = std::function<void(const std::shared_ptr<IQChatAttachInterface>&, NIMQChatMessage&)>

◆ AttachRawCreateFunc

using nim::QChatMessageSend::AttachRawCreateFunc = std::function<std::shared_ptr<IQChatAttachInterface>(const std::string&)>

构造及析构函数说明

◆ QChatMessageSend() [1/2]

nim::QChatMessageSend::QChatMessageSend ( )
default

◆ QChatMessageSend() [2/2]

nim::QChatMessageSend::QChatMessageSend ( const NIMQChatMessage c_param)
inline

成员函数说明

◆ CreateAttach()

std::shared_ptr< IQChatAttachInterface > nim::QChatMessageSend::CreateAttach ( const NIMQChatMessage m)
inlineprivate

◆ CreateAttachWithRawData()

static std::shared_ptr< IQChatAttachInterface > nim::QChatMessageSend::CreateAttachWithRawData ( NIMQChatMsgType  type,
const std::string &  raw_data 
)
inlinestatic

◆ GetOriginAttach()

template<typename ATTACH_TYPE >
static std::shared_ptr< ATTACH_TYPE > nim::QChatMessageSend::GetOriginAttach ( const std::shared_ptr< IQChatAttachInterface > &  p)
inlinestaticprivate

◆ ParseAttach()

void nim::QChatMessageSend::ParseAttach ( const std::shared_ptr< IQChatAttachInterface > &  p,
NIMQChatMessage cp 
) const
inlineprivate

◆ ToCParam()

NIMQChatMessage nim::QChatMessageSend::ToCParam ( ) const
inline

类成员变量说明

◆ anti_spam_info

QChatMessageAntiSpamInfo nim::QChatMessageSend::anti_spam_info

反垃圾信息

◆ attach_create_functions_

std::map<NIMQChatMsgType, AttachCreateFunc> nim::QChatMessageSend::attach_create_functions_
private
初始值:
= {
{ kNIMQChatMsgTypeText, [](const NIMQChatMessage& m) { return std::make_shared<QChatDefaultAttach>(m.default_attach); } },
{ kNIMQChatMsgTypeImage, [](const NIMQChatMessage& m) { return std::make_shared<QChatImageAttach>(m.image_attach); } },
{ kNIMQChatMsgTypeAudio, [](const NIMQChatMessage& m) { return std::make_shared<QChatAudioAttach>(m.audio_attach); } },
{ kNIMQChatMsgTypeVideo, [](const NIMQChatMessage& m) { return std::make_shared<QChatVideoAttach>(m.video_attach); } },
{ kNIMQChatMsgTypeFile, [](const NIMQChatMessage& m) { return std::make_shared<QChatFileAttach>(m.file_attach); } },
{ kNIMQChatMsgTypeLocation, [](const NIMQChatMessage& m) { return std::make_shared<QChatLocationAttach>(m.location_attach); } },
{ kNIMQChatMsgTypeNotification, [](const NIMQChatMessage& m) { return std::make_shared<QChatNotificationAttach>(m.notification_attach); } },
{ kNIMQChatMsgTypeTips, [](const NIMQChatMessage& m) { return std::make_shared<QChatTipsAttach>(m.tips_attach); } }
}
@ kNIMQChatMsgTypeNotification
通知类型消息
Definition: nim_qchat_message_def.h:58
@ kNIMQChatMsgTypeVideo
视频类型消息
Definition: nim_qchat_message_def.h:54
@ kNIMQChatMsgTypeText
文本类型消息
Definition: nim_qchat_message_def.h:48
@ kNIMQChatMsgTypeTips
提醒类型消息
Definition: nim_qchat_message_def.h:62
@ kNIMQChatMsgTypeAudio
音频类型消息
Definition: nim_qchat_message_def.h:52
@ kNIMQChatMsgTypeLocation
位置类型消息
Definition: nim_qchat_message_def.h:56
@ kNIMQChatMsgTypeFile
文件类型消息
Definition: nim_qchat_message_def.h:60
@ kNIMQChatMsgTypeImage
图片类型消息
Definition: nim_qchat_message_def.h:50
Definition: nim_qchat_message_def.h:204

◆ attach_parse_functions_

std::map<NIMQChatMsgType, AttachParseFunc> nim::QChatMessageSend::attach_parse_functions_
private
初始值:
= {
{kNIMQChatMsgTypeText, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.default_attach = GetOriginAttach<QChatDefaultAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeImage, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.image_attach = GetOriginAttach<QChatImageAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeAudio, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.audio_attach = GetOriginAttach<QChatAudioAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeVideo, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.video_attach = GetOriginAttach<QChatVideoAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeFile, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.file_attach = GetOriginAttach<QChatFileAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeLocation, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.location_attach = GetOriginAttach<QChatLocationAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeNotification, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.notification_attach = GetOriginAttach<QChatNotificationAttach>(p)->ToCParam(); } },
{kNIMQChatMsgTypeTips, [](const std::shared_ptr<IQChatAttachInterface>& p, NIMQChatMessage& cp)
{ cp.tips_attach = GetOriginAttach<QChatTipsAttach>(p)->ToCParam(); } }
}

◆ attach_raw_create_function_

std::map< NIMQChatMsgType, QChatMessageSend::AttachRawCreateFunc > nim::QChatMessageSend::attach_raw_create_function_
static
初始值:
= {
{ kNIMQChatMsgTypeText, [](const std::string& r) { return std::make_shared<QChatDefaultAttach>(r); } },
{ kNIMQChatMsgTypeImage, [](const std::string& r) { return std::make_shared<QChatImageAttach>(r); } },
{ kNIMQChatMsgTypeAudio, [](const std::string& r) { return std::make_shared<QChatAudioAttach>(r); } },
{ kNIMQChatMsgTypeVideo, [](const std::string& r) { return std::make_shared<QChatVideoAttach>(r); } },
{ kNIMQChatMsgTypeFile, [](const std::string& r) { return std::make_shared<QChatFileAttach>(r); } },
{ kNIMQChatMsgTypeLocation, [](const std::string& r) { return std::make_shared<QChatLocationAttach>(r); } },
{ kNIMQChatMsgTypeNotification, [](const std::string& r) { return std::make_shared<QChatNotificationAttach>(r); } },
{ kNIMQChatMsgTypeTips, [](const std::string& r) { return std::make_shared<QChatTipsAttach>(r); } }
}

◆ c_mention_accids

std::vector<char*> nim::QChatMessageSend::c_mention_accids
mutableprotected

◆ channel_id

uint64_t nim::QChatMessageSend::channel_id {0}

消息所属的channel id

◆ env

std::string nim::QChatMessageSend::env

环境变量

◆ history_enable

bool nim::QChatMessageSend::history_enable {true}

该消息是否存储云端历史,0:不支持,1:支持

◆ mention_accids

std::vector<std::string> nim::QChatMessageSend::mention_accids {}

@成员列表

◆ mention_all

bool nim::QChatMessageSend::mention_all {false}

是否@所有人,false:否,true:是

◆ mention_role_ids

std::vector<uint64_t> nim::QChatMessageSend::mention_role_ids {}

@身份组列表

◆ msg_attach

std::shared_ptr<IQChatAttachInterface> nim::QChatMessageSend::msg_attach {std::make_shared<QChatDefaultAttach>()}

消息附件

◆ msg_body

std::string nim::QChatMessageSend::msg_body {""}

消息内容

◆ msg_ext

std::string nim::QChatMessageSend::msg_ext {""}

消息扩展字段

◆ msg_id

std::string nim::QChatMessageSend::msg_id {""}

消息重发时需要指定此参数

◆ msg_sub_type

uint32_t nim::QChatMessageSend::msg_sub_type {0}

可选, 消息子类型

◆ msg_type

NIMQChatMsgType nim::QChatMessageSend::msg_type {kNIMQChatMsgTypeUnknown}

消息类型

◆ need_badge

bool nim::QChatMessageSend::need_badge {true}

是否需要消息计数, false: 不需要, true: 需要, 默认 true

◆ need_push_nick

bool nim::QChatMessageSend::need_push_nick {true}

是否需要推送昵称, false: 不需要, true: 需要, 默认 true

◆ push_content

std::string nim::QChatMessageSend::push_content {""}

自定义的推送内容

◆ push_enable

bool nim::QChatMessageSend::push_enable {false}

是否需要推送, false: 不需要, true: 需要, 默认 false

◆ push_payload

std::string nim::QChatMessageSend::push_payload {""}

自定义的推送属性,限制json

◆ resend_flag

bool nim::QChatMessageSend::resend_flag {false}

重发标记,false:不是重发,true:是重发

◆ route_enable

bool nim::QChatMessageSend::route_enable {true}

是否需要抄送, false: 不需要, true: 需要, 默认 true

◆ server_id

uint64_t nim::QChatMessageSend::server_id {0}

消息所属的server id

◆ thread_info

QChatMessageThreadInfo nim::QChatMessageSend::thread_info

thread 消息相关信息


该结构体的文档由以下文件生成: