NIM SDK API  9.0.0
nim_msg_helper.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_MESSAGE_HELPER_H_
8 #define _NIM_SDK_CPP_MESSAGE_HELPER_H_
9 
10 #include <functional>
11 #include <list>
12 #include <string>
14 #include "nim_define_include.h"
15 #include "nim_wrapper_util/json/json.h"
16 
21 namespace nim {
22 
24 struct NIM_SDK_CPPWRAPPER_DLL_API SendMessageArc {
25  std::string talk_id_;
26  std::string msg_id_;
27  NIMResCode rescode_;
28  int64_t msg_timetag_;
30  std::string anti_spam_res_;
32  std::string ToJsonString() const {
33  nim_cpp_wrapper_util::Json::Value values;
34  values[kNIMMsgKeyLocalTalkId] = talk_id_;
35  values[kNIMSendAckKeyMsgId] = msg_id_;
36  values[kNIMSendAckKeyRescode] = rescode_;
37  values[kNIMSendAckKeyTimetag] = msg_timetag_;
38  values[kNIMSendAckKeyCallbackExt] = third_party_callback_ext_;
39  values[kNIMSendAckKeyAntiSpamRes] = anti_spam_res_;
40  return nim_cpp_wrapper_util::Json::FastWriter().write(values);
41  }
42 };
43 
45 struct NIM_SDK_CPPWRAPPER_DLL_API RecallMsgNotify {
46  std::string from_id_;
47  std::string to_id_;
48  std::string msg_id_;
49  std::string notify_;
50  std::string from_nick_;
51  std::string operator_id_;
52  NIMSessionType session_type_;
53  int64_t notify_timetag_;
54  NIMMessageFeature notify_feature_;
56  int64_t msglog_timetag_;
57  std::string attach_;
58  std::string callback_ext_;
60  : notify_timetag_(0)
61  , msglog_exist_(true)
62  , msglog_timetag_(0) {}
63 };
64 
72 NIM_SDK_CPPWRAPPER_DLL_API bool ParseRecallMsgNotify(const std::string json_value, RecallMsgNotify& notify);
73 
80 NIM_SDK_CPPWRAPPER_DLL_API bool ParseRecallMsgNotify(const std::string& notify_json, std::list<RecallMsgNotify>& notifys);
81 
88 NIM_SDK_CPPWRAPPER_DLL_API bool ParseSendMessageAck(const std::string& arc_json, SendMessageArc& arc);
89 
90 } // namespace nim
91 
92 #endif //_NIM_SDK_CPP_MESSAGE_HELPER_H_
nim::RecallMsgNotify::from_nick_
std::string from_nick_
Definition: nim_msg_helper.h:50
nim::RecallMsgNotify::msglog_exist_
bool msglog_exist_
Definition: nim_msg_helper.h:55
nim::SendMessageArc::third_party_callback_ext_
std::string third_party_callback_ext_
Definition: nim_msg_helper.h:29
nim::ParseSendMessageAck
NIM_SDK_CPPWRAPPER_DLL_API bool ParseSendMessageAck(const std::string &arc_json, SendMessageArc &arc)
解析发送消息回执
nim::ParseRecallMsgNotify
NIM_SDK_CPPWRAPPER_DLL_API bool ParseRecallMsgNotify(const std::string json_value, RecallMsgNotify &notify)
解析消息撤回通知
nim::SendMessageArc::anti_spam_res_
std::string anti_spam_res_
Definition: nim_msg_helper.h:30
nim::RecallMsgNotify
消息撤回通知
Definition: nim_msg_helper.h:45
nim::SendMessageArc::msg_id_
std::string msg_id_
Definition: nim_msg_helper.h:26
nim::RecallMsgNotify::notify_
std::string notify_
Definition: nim_msg_helper.h:49
nim::RecallMsgNotify::attach_
std::string attach_
Definition: nim_msg_helper.h:57
nim::RecallMsgNotify::msglog_timetag_
int64_t msglog_timetag_
Definition: nim_msg_helper.h:56
nim
namespace nim
nim::SendMessageArc::talk_id_
std::string talk_id_
Definition: nim_msg_helper.h:25
nim::SendMessageArc::rescode_
NIMResCode rescode_
Definition: nim_msg_helper.h:27
nim::SendMessageArc::msg_timetag_
int64_t msg_timetag_
Definition: nim_msg_helper.h:28
nim::RecallMsgNotify::notify_timetag_
int64_t notify_timetag_
Definition: nim_msg_helper.h:53
nim::RecallMsgNotify::callback_ext_
std::string callback_ext_
Definition: nim_msg_helper.h:58
nim::RecallMsgNotify::to_id_
std::string to_id_
Definition: nim_msg_helper.h:47
nim::RecallMsgNotify::notify_feature_
NIMMessageFeature notify_feature_
Definition: nim_msg_helper.h:54
nim::SendMessageArc
发送消息回执
Definition: nim_msg_helper.h:24
nim::RecallMsgNotify::from_id_
std::string from_id_
Definition: nim_msg_helper.h:46
nim::RecallMsgNotify::msg_id_
std::string msg_id_
Definition: nim_msg_helper.h:48
nim::RecallMsgNotify::operator_id_
std::string operator_id_
Definition: nim_msg_helper.h:51
nim_sdk_cpp_wrapper.h
定义导出宏
nim::RecallMsgNotify::session_type_
NIMSessionType session_type_
Definition: nim_msg_helper.h:52