7#ifndef _NIM_SDK_CPP_TALK_H_
8#define _NIM_SDK_CPP_TALK_H_
25class NIM_SDK_CPPWRAPPER_DLL_API
Talk {
64 static void RegSendMsgCb(
const SendMsgAckCallback& cb,
const std::string& json_extension =
"");
73 static void SendMsg(
const std::string& json_msg,
const std::string& json_extension =
"",
FileUpPrgCallback* pcb =
nullptr);
91 static bool StopSendMsg(
const std::string& client_msg_id,
const NIMMessageType& type,
const std::string& json_extension =
"");
102 static void RegReceiveCb(
const ReceiveMsgCallback& cb,
const std::string& json_extension =
"");
111 static void RegReceiveMessagesCb(
const ReceiveMsgsCallback& cb,
const std::string& json_extension =
"");
130 static std::string CreateTextMessage(
const std::string& receiver_id,
132 const std::string& client_msg_id,
133 const std::string& content,
136 int32_t sub_type = 0);
157 static std::string CreateImageMessage(
const std::string& receiver_id,
159 const std::string& client_msg_id,
161 const std::string& file_path,
164 int32_t sub_type = 0);
185 static std::string CreateFileMessage(
const std::string& receiver_id,
187 const std::string& client_msg_id,
189 const std::string& file_path,
192 int32_t sub_type = 0);
213 static std::string CreateAudioMessage(
const std::string& receiver_id,
215 const std::string& client_msg_id,
217 const std::string& file_path,
220 int32_t sub_type = 0);
241 static std::string CreateVideoMessage(
const std::string& receiver_id,
243 const std::string& client_msg_id,
245 const std::string& file_path,
248 int32_t sub_type = 0);
267 static std::string CreateLocationMessage(
const std::string& receiver_id,
269 const std::string& client_msg_id,
273 int32_t sub_type = 0);
292 static std::string CreateTipMessage(
const std::string& receiver_id,
294 const std::string& client_msg_id,
295 const std::string& tip,
298 int32_t sub_type = 0);
319 static std::string CreateBotRobotMessage(
const std::string& receiver_id,
321 const std::string& client_msg_id,
322 const std::string& content,
326 int32_t sub_type = 0);
345 static std::string CreateG2NetCallMessage(
const std::string& receiver_id,
347 const std::string& client_msg_id,
348 const std::string& msg_attach,
351 int32_t sub_type = 0);
368 static std::string CreateRetweetMessage(
const std::string& src_msg_json,
369 const std::string& client_msg_id,
371 const std::string& retweet_to_session_id,
373 int64_t timetag = 0);
381 static bool ParseIMMessage(
const std::string& json_msg,
IMMessage& msg);
397 static bool ParseFileMessageAttach(
const IMMessage& msg,
IMFile& file);
435 static void UnregTalkCb();
443 static void RegTeamNotificationFilter(
const TeamNotificationFilter& filter,
const std::string& json_extension =
"");
451 static void RegMessageFilter(
const MessageFilter& filter,
const std::string& json_extension =
"");
460 static void RegRecallMsgsCallback(
const RecallMsgsCallback& cb,
const std::string& json_extension =
"");
478 static void RecallMsg(
const IMMessage& msg,
const std::string& notify,
const RecallMsgsCallback& cb,
const std::string& json_extension =
"");
500 static void RecallMsg2(
const IMMessage& msg,
501 const std::string& notify,
503 const std::string& apnstext =
"",
504 const std::string& pushpayloadconst =
"",
505 const std::string& json_extension =
"");
529 static std::string GetAttachmentPathFromMsg(
const IMMessage& msg);
聊天功能;主要包括发送消息、接收消息等功能
Definition: nim_cpp_talk.h:25
std::function< void(const std::list< BroadcastMessage > &)> ReceiveBroadcastMsgsCallback
批量接收广播消息通知回调模板
Definition: nim_cpp_talk.h:42
std::function< void(const IMMessage &)> ReceiveMsgCallback
接收消息通知回调模板
Definition: nim_cpp_talk.h:30
std::function< bool(const IMMessage &)> MessageFilter
消息过滤器
Definition: nim_cpp_talk.h:44
std::function< void(int64_t, int64_t)> FileUpPrgCallback
发送多媒体消息文件上传过程回调模板
Definition: nim_cpp_talk.h:34
std::function< void(const SendMessageArc &)> SendMsgAckCallback
发送消息回执通知回调模板
Definition: nim_cpp_talk.h:28
std::function< std::string(const IMMessage &)> AntiCheatingFieldFillCallback
易盾反垃圾增强反作弊字段填充回调模板
Definition: nim_cpp_talk.h:46
std::function< void(const std::list< IMMessage > &)> ReceiveMsgsCallback
批量接收消息通知回调模板
Definition: nim_cpp_talk.h:32
std::function< void(const BroadcastMessage &)> ReceiveBroadcastMsgCallback
接收广播消息通知回调模板
Definition: nim_cpp_talk.h:40
std::function< void(const NIMResCode, const std::list< RecallMsgNotify > &)> RecallMsgsCallback
消息撤回通知回调模板
Definition: nim_cpp_talk.h:38
std::function< bool(const IMMessage &)> TeamNotificationFilter
群通知过滤器
Definition: nim_cpp_talk.h:36
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
NIMMessageType
Definition: nim_msglog_def.h:269
NIMSessionType
Definition: nim_session_def.h:16
Definition: nim_talk_helper.h:638
语音消息附件
Definition: nim_talk_helper.h:555
波特机器人消息附件
Definition: nim_talk_helper.h:605
文件消息附件
Definition: nim_talk_helper.h:450
图片消息附件
Definition: nim_talk_helper.h:502
位置消息附件
Definition: nim_talk_helper.h:527
Definition: nim_talk_helper.h:281
小视频消息附件
Definition: nim_talk_helper.h:576
消息属性设置
Definition: nim_talk_helper.h:24
发送消息回执
Definition: nim_msg_helper.h:24