7 #ifndef _NIM_SDK_CPP_TALK_H_
8 #define _NIM_SDK_CPP_TALK_H_
25 class NIM_SDK_CPPWRAPPER_DLL_API
Talk {
32 typedef std::function<void(
const NIMResCode,
const std::list<RecallMsgNotify>&)>
RecallMsgsCallback;
54 static void RegSendMsgCb(
const SendMsgAckCallback& cb,
const std::string& json_extension =
"");
63 static void SendMsg(
const std::string& json_msg,
const std::string& json_extension =
"",
FileUpPrgCallback* pcb =
nullptr);
72 static bool StopSendMsg(
const std::string& client_msg_id,
const NIMMessageType& type,
const std::string& json_extension =
"");
83 static void RegReceiveCb(
const ReceiveMsgCallback& cb,
const std::string& json_extension =
"");
92 static void RegReceiveMessagesCb(
const ReceiveMsgsCallback& cb,
const std::string& json_extension =
"");
111 static std::string CreateTextMessage(
const std::string& receiver_id,
112 const NIMSessionType session_type,
113 const std::string& client_msg_id,
114 const std::string& content,
117 int32_t sub_type = 0);
138 static std::string CreateImageMessage(
const std::string& receiver_id,
139 const NIMSessionType session_type,
140 const std::string& client_msg_id,
142 const std::string& file_path,
145 int32_t sub_type = 0);
166 static std::string CreateFileMessage(
const std::string& receiver_id,
167 const NIMSessionType session_type,
168 const std::string& client_msg_id,
170 const std::string& file_path,
173 int32_t sub_type = 0);
194 static std::string CreateAudioMessage(
const std::string& receiver_id,
195 const NIMSessionType session_type,
196 const std::string& client_msg_id,
198 const std::string& file_path,
201 int32_t sub_type = 0);
222 static std::string CreateVideoMessage(
const std::string& receiver_id,
223 const NIMSessionType session_type,
224 const std::string& client_msg_id,
226 const std::string& file_path,
229 int32_t sub_type = 0);
248 static std::string CreateLocationMessage(
const std::string& receiver_id,
249 const NIMSessionType session_type,
250 const std::string& client_msg_id,
254 int32_t sub_type = 0);
273 static std::string CreateTipMessage(
const std::string& receiver_id,
274 const NIMSessionType session_type,
275 const std::string& client_msg_id,
276 const std::string& tip,
279 int32_t sub_type = 0);
300 static std::string CreateBotRobotMessage(
const std::string& receiver_id,
301 const NIMSessionType session_type,
302 const std::string& client_msg_id,
303 const std::string& content,
307 int32_t sub_type = 0);
326 static std::string CreateG2NetCallMessage(
const std::string& receiver_id,
327 const NIMSessionType session_type,
328 const std::string& client_msg_id,
329 const std::string& msg_attach,
332 int32_t sub_type = 0);
349 static std::string CreateRetweetMessage(
const std::string& src_msg_json,
350 const std::string& client_msg_id,
351 const NIMSessionType retweet_to_session_type,
352 const std::string& retweet_to_session_id,
354 int64_t timetag = 0);
362 static bool ParseIMMessage(
const std::string& json_msg,
IMMessage& msg);
378 static bool ParseFileMessageAttach(
const IMMessage& msg,
IMFile& file);
416 static void UnregTalkCb();
424 static void RegTeamNotificationFilter(
const TeamNotificationFilter& filter,
const std::string& json_extension =
"");
432 static void RegMessageFilter(
const MessageFilter& filter,
const std::string& json_extension =
"");
441 static void RegRecallMsgsCallback(
const RecallMsgsCallback& cb,
const std::string& json_extension =
"");
459 static void RecallMsg(
const IMMessage& msg,
const std::string& notify,
const RecallMsgsCallback& cb,
const std::string& json_extension =
"");
481 static void RecallMsg2(
const IMMessage& msg,
482 const std::string& notify,
484 const std::string& apnstext =
"",
485 const std::string& pushpayloadconst =
"",
486 const std::string& json_extension =
"");
503 static void RecallMsgEx(
const IMMessage& msg,
const std::string& notify,
const RecallMsgsCallback& cb, nim_talk_recall_extra_params& extra_param);
510 static std::string GetAttachmentPathFromMsg(
const IMMessage& msg);
544 #endif //_NIM_SDK_CPP_TALK_H_