NIM SDK API  8.7.0
nim_chatroom_helper.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_CHATROOM_SDK_CPP_HELPER_H_
8 #define _NIM_CHATROOM_SDK_CPP_HELPER_H_
9 
10 #include <algorithm>
11 #include <functional>
12 #include <list>
13 #include <map>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 #if !defined(_WIN32) && !defined(WIN32)
18 #include <pthread.h>
19 #endif
21 #include "nim_chatroom_def_include.h"
22 #include "nim_wrapper_util/nim_json_util.h"
23 
28 namespace nim_chatroom {
29 
31 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomEnterInfo {
37  void SetNick(const std::string& nick) { values_[kNIMChatRoomEnterKeyNick] = nick; }
38 
44  void SetAvatar(const std::string& avatar) { values_[kNIMChatRoomEnterKeyAvatar] = avatar; }
45 
51  void SetExt(const nim_cpp_wrapper_util::Json::Value& ext) { values_[kNIMChatRoomEnterKeyExt] = nim::GetJsonStringWithNoStyled(ext); }
52 
58  void SetNotifyExt(const nim_cpp_wrapper_util::Json::Value& notify_ext) {
59  values_[kNIMChatRoomEnterKeyNotifyExt] = nim::GetJsonStringWithNoStyled(notify_ext);
60  }
61 
67  void SetLoginTag(const std::list<std::string>& login_tags) {
68  for (auto& tag : login_tags) {
69  values_[kNIMChatRoomEnterLoginTags].append(tag);
70  }
71  }
72 
78  void SetNotifyTags(const std::string& expression) { values_[kNIMChatRoomEnterNotifyTags] = expression; }
79 
84  std::string ToJsonString() const { return values_.empty() ? "" : nim::GetJsonStringWithNoStyled(values_); }
85 
86 private:
87  nim_cpp_wrapper_util::Json::Value values_;
88 };
89 
90 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomIndependentEnterInfo {
91  std::list<std::string> address_;
92  std::string app_data_file_;
94  std::string app_key_;
95  std::string accid_;
96  std::string token_;
97  std::list<std::string> login_tags_;
98  std::string notify_tags_;
100  ChatRoomIndependentEnterInfo() { sdk_log_level_ = 5; }
101 
106  std::string ToJsonString() const {
107  nim_cpp_wrapper_util::Json::Value values;
108  nim_cpp_wrapper_util::Json::FastWriter fw;
109  std::string addr_str;
110  nim::StrListToJsonString(address_, addr_str);
111  values[kNIMChatRoomEnterKeyAddress] = addr_str;
112  std::string login_tags;
113  nim::StrListToJsonString(login_tags_, login_tags);
114  values[kNIMChatRoomEnterLoginTags] = login_tags;
115  values[kNIMChatRoomEnterKeyAppDataPath] = app_data_file_;
116  values[kNIMChatRoomEnterKeyLogLevel] = sdk_log_level_;
117  values[kNIMChatRoomEnterKeyAppKey] = app_key_;
118  values[kNIMChatRoomEnterKeyAccID] = accid_;
119  values[kNIMChatRoomEnterKeyToken] = token_;
120  values[kNIMChatRoomEnterNotifyTags] = notify_tags_;
121  return fw.write(values);
122  }
123 };
124 
125 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomAnoymityEnterInfo {
126  std::list<std::string> address_;
127  std::string
132  std::string app_key_;
133  bool random_id_;
134  std::list<std::string> login_tags_;
135  std::string notify_tags_;
138  sdk_log_level_ = 5;
139  random_id_ = false;
140  }
141 
146  std::string ToJsonString() const {
147  nim_cpp_wrapper_util::Json::Value values;
148  nim_cpp_wrapper_util::Json::FastWriter fw;
149  std::string addr_str;
150  nim::StrListToJsonString(address_, addr_str);
151  values[kNIMChatRoomEnterKeyAddress] = addr_str;
152  std::string login_tags;
153  nim::StrListToJsonString(login_tags_, login_tags);
154  values[kNIMChatRoomEnterLoginTags] = login_tags;
155  values[kNIMChatRoomEnterKeyAppDataPath] = app_data_file_;
156  values[kNIMChatRoomEnterKeyLogLevel] = sdk_log_level_;
157  values[kNIMChatRoomEnterKeyAppKey] = app_key_;
158  values[kNIMChatRoomEnterKeyRandomID] = random_id_ ? 1 : 0;
159  values[kNIMChatRoomEnterNotifyTags] = notify_tags_;
160  return fw.write(values);
161  }
162 };
163 
165 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomInfo {
166  int64_t id_;
167  std::string name_;
168  std::string announcement_;
169  std::string broadcast_url_;
170  std::string creator_id_;
172  std::string ext_;
174  int mute_all_;
178  : id_(0)
179  , valid_flag_(0)
180  , mute_all_(0)
181  , queuelevel(1) {}
182 
188  void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value& values) {
189  id_ = values[kNIMChatRoomInfoKeyID].asUInt64();
190  name_ = values[kNIMChatRoomInfoKeyName].asString();
191  announcement_ = values[kNIMChatRoomInfoKeyAnnouncement].asString();
192  broadcast_url_ = values[kNIMChatRoomInfoKeyBroadcastUrl].asString();
193  creator_id_ = values[kNIMChatRoomInfoKeyCreatorID].asString();
194  valid_flag_ = values[kNIMChatRoomInfoKeyValidFlag].asUInt();
195  ext_ = values[kNIMChatRoomInfoKeyExt].asString();
196  online_count_ = values[kNIMChatRoomInfoKeyOnlineCount].asUInt();
197  mute_all_ = values[kNIMChatRoomInfoKeyMuteAll].asUInt();
198  queuelevel = values[kNIMChatRoomInfoKeyQueuelevel].asInt();
199  }
200 
205  std::string ToJsonString() const {
206  nim_cpp_wrapper_util::Json::Value values;
207  values[kNIMChatRoomInfoKeyID] = id_;
208  values[kNIMChatRoomInfoKeyName] = name_;
209  values[kNIMChatRoomInfoKeyAnnouncement] = announcement_;
210  values[kNIMChatRoomInfoKeyBroadcastUrl] = broadcast_url_;
211  values[kNIMChatRoomInfoKeyCreatorID] = creator_id_;
212  values[kNIMChatRoomInfoKeyValidFlag] = valid_flag_;
213  values[kNIMChatRoomInfoKeyExt] = ext_;
214  values[kNIMChatRoomInfoKeyOnlineCount] = online_count_;
215  values[kNIMChatRoomInfoKeyMuteAll] = mute_all_;
216  values[kNIMChatRoomInfoKeyQueuelevel] = queuelevel;
217  return nim::GetJsonStringWithNoStyled(values);
218  }
219 };
220 
222 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomNotification {
223  NIMChatRoomNotificationId id_;
224  std::string ext_;
225  std::string operator_id_;
226  std::string operator_nick_;
227  std::list<std::string> target_nick_;
228  std::list<std::string> target_ids_;
231  bool muted_;
232  bool temp_muted_;
233  std::string queue_change_;
236  std::string target_tag_;
239  std::string msg_id_;
240  uint64_t msg_timetag_;
244  : temp_mute_duration_(0)
245  , muted_(false)
246  , temp_muted_(false)
247  , msg_timetag_(0) {}
248 
254  void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value& values) {
255  id_ = (NIMChatRoomNotificationId)values[kChatRoomNotificationKeyID].asUInt();
256  ext_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyExt].asString();
257  operator_id_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyOpt].asString();
258  operator_nick_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyOptNick].asString();
259  nim::JsonStrArrayToList(values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyTargetNick], target_nick_);
260  nim::JsonStrArrayToList(values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyTarget], target_ids_);
261  if (id_ == kNIMChatRoomNotificationIdMemberTempMute || id_ == kNIMChatRoomNotificationIdMemberTempUnMute)
262  temp_mute_duration_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyTempMuteDuration].asInt64();
263  if (id_ == kNIMChatRoomNotificationIdMemberIn) {
264  if (values[kChatRoomNotificationKeyData].isMember(kChatRoomNotificationDataKeyMuteFlag))
265  muted_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyMuteFlag].asUInt() == 1;
266  if (values[kChatRoomNotificationKeyData].isMember(kChatRoomNotificationDataKeyTempMutedFlag))
267  temp_muted_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyTempMutedFlag].asUInt() == 1;
268  temp_mute_duration_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyMemberInTempMutedDuration].asInt64();
269  }
270  if (id_ == kNIMChatRoomNotificationIdQueueChanged) {
271  queue_change_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyQueueChange].asString();
272  }
273  if (id_ == kNIMChatRoomNotificationIdQueueBatchChanged) {
274  queue_change_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyQueueChange].asString();
275  }
276  if (id_ == kNIMChatRoomNotificationIdTagTempMuteAdd || id_ == kNIMChatRoomNotificationIdTagTempMuteRemove) {
277  if (values[kChatRoomNotificationKeyData].isMember(kChatRoomNotificationDataKeyTargetTag)) {
278  target_tag_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyTargetTag].asString();
279  }
280  }
281  if (id_ == kNIMChatRoomNotificationIdRecallMessage) {
282  if (values[kChatRoomNotificationKeyData].isMember(kChatRoomNotificationDataKeyMsgTimetag)) {
283  msg_timetag_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyMsgTimetag].asUInt64();
284  }
285  if (values[kChatRoomNotificationKeyData].isMember(kChatRoomNotificationDataKeyMsgId)) {
286  msg_id_ = values[kChatRoomNotificationKeyData][kChatRoomNotificationDataKeyMsgId].asString();
287  }
288  }
289  }
290 
291  std::string ToJsonString() const {
292  nim_cpp_wrapper_util::Json::Value values;
293  values[kNIMChatRoomInfoKeyID] = id_;
294  values[kChatRoomNotificationDataKeyExt] = ext_;
295  values[kChatRoomNotificationDataKeyOpt] = operator_id_;
296  values[kChatRoomNotificationDataKeyOptNick] = operator_nick_;
297  for (const auto& nick : target_nick_) {
298  values[kChatRoomNotificationDataKeyTargetNick].append(nick);
299  }
300  for (const auto& id : target_ids_) {
301  values[kChatRoomNotificationDataKeyTarget].append(id);
302  }
303  values[kChatRoomNotificationDataKeyTempMuteDuration] = temp_mute_duration_;
304  values[kChatRoomNotificationDataKeyMuteFlag] = muted_;
305  values[kChatRoomNotificationDataKeyTempMutedFlag] = temp_muted_;
306  values[kChatRoomNotificationDataKeyQueueChange] = queue_change_;
307  if (!target_tag_.empty())
308  values[kChatRoomNotificationDataKeyTargetTag] = target_tag_;
309  if (!msg_id_.empty()) {
310  values[kChatRoomNotificationDataKeyMsgTimetag] = msg_timetag_;
311  values[kChatRoomNotificationDataKeyMsgId] = msg_id_;
312  }
313 
314  return nim::GetJsonStringWithNoStyled(values);
315  }
316 };
317 
319 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomQueueOfferOption {
320 public:
321  bool transient_;
322  std::string element_accid_;
324  : transient_(false) {}
325  std::string ToJsonString() const {
326  nim_cpp_wrapper_util::Json::Value values;
327  nim_cpp_wrapper_util::Json::FastWriter writer;
328  values[kNIMChatRoomQueueOfferOptionTransient] = transient_;
329  if (!element_accid_.empty())
330  values[kNIMChatRoomQueueOfferOptionElementAccId] = element_accid_;
331  return writer.write(values);
332  }
333 };
334 
336 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomQueueChangedNotification {
337  std::string type_;
338  std::string key_;
339  std::string value_;
346  void ParseFromNotification(const ChatRoomNotification& notification) {
347  nim_cpp_wrapper_util::Json::Value values;
348  nim_cpp_wrapper_util::Json::Reader reader;
349  if (reader.parse(notification.queue_change_, values) && values.isObject()) {
350  type_ = values[kNIMChatRoomNotificationQueueChangedKeyType].asString();
351  key_ = values[kNIMChatRoomNotificationQueueChangedKeyKey].asString();
352  value_ = values[kNIMChatRoomNotificationQueueChangedKeyValue].asString();
353  }
354  }
355 };
356 
358 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomQueueBatchChangedNotification {
359  std::string type_;
360  std::string key_;
361  std::string value_;
362  std::map<std::string, std::string> changed_values_;
369  void ParseFromNotification(const ChatRoomNotification& notification) {
370  nim_cpp_wrapper_util::Json::Value values;
371  nim_cpp_wrapper_util::Json::Reader reader;
372  if (reader.parse(notification.queue_change_, values) && values.isObject()) {
373  type_ = values[kNIMChatRoomNotificationQueueBatchChangedKeyType].asString();
374  if (values.isMember(kNIMChatRoomNotificationQueueBatchChangedKeyKey))
375  key_ = values[kNIMChatRoomNotificationQueueBatchChangedKeyKey].asString();
376  if (values.isMember(kNIMChatRoomNotificationQueueBatchChangedKeyValue))
377  value_ = values[kNIMChatRoomNotificationQueueBatchChangedKeyValue].asString();
378  if (values.isMember(kNIMChatRoomNotificationQueueBatchChangedKeyObject)) {
379  auto members_name = values[kNIMChatRoomNotificationQueueBatchChangedKeyObject].getMemberNames();
380  auto it = members_name.begin();
381  while (it != members_name.end()) {
382  changed_values_.insert(std::make_pair(*it, values[kNIMChatRoomNotificationQueueBatchChangedKeyObject][*it].asString()));
383  it++;
384  }
385  }
386  }
387  }
388 };
389 
391 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomMessageSetting {
393  std::string ext_;
395  std::string anti_spam_content_;
397  std::string anti_spam_bizid_;
401  std::string yidun_anti_cheating_;
402  std::string env_config_;
403  std::string anti_spam_ext_;
406  : resend_flag_(false)
407  , anti_spam_enable_(false)
408  , history_save_(true)
409  , anti_spam_bizid_("")
410  , anti_spam_using_yidun_(1)
411  , high_priority_(0)
412  , yidun_anti_cheating_("")
413  , anti_spam_ext_("") {}
414 
420  void ToJsonValue(nim_cpp_wrapper_util::Json::Value& message) const {
421  message[kNIMChatRoomMsgKeyResendFlag] = resend_flag_ ? 1 : 0;
422  message[kNIMChatRoomMsgKeyExt] = ext_;
423  message[kNIMChatRoomMsgKeyAntiSpamEnable] = anti_spam_enable_ ? 1 : 0;
424  message[kNIMChatRoomMsgKeyAntiSpamContent] = anti_spam_content_;
425  if (!anti_spam_bizid_.empty())
426  message[kNIMChatRoomMsgKeyAntiSpamBizId] = anti_spam_bizid_;
427  message[kNIMChatRoomMsgKeyHistorySave] = history_save_ ? 1 : 0;
428  message[kNIMChatRoomMsgKeyAntiSpamUsingYiDun] = anti_spam_using_yidun_;
429  if (!yidun_anti_cheating_.empty())
430  message[kNIMChatRoomMsgKeyYiDunAntiCheating] = yidun_anti_cheating_;
431  if (!env_config_.empty())
432  message[kNIMChatRoomMsgKeyEnvConfig] = env_config_;
433  if (!anti_spam_ext_.empty())
434  message[kNIMChatRoomMsgKeyAntiSpamExt] = anti_spam_ext_;
435  }
436 
442  void ParseMessageSetting(const nim_cpp_wrapper_util::Json::Value& message) {
443  resend_flag_ = message[kNIMChatRoomMsgKeyResendFlag].asUInt() == 1;
444  ext_ = message[kNIMChatRoomMsgKeyExt].asString();
445  if (message.isMember(kNIMChatRoomMsgKeyAntiSpamEnable))
446  anti_spam_enable_ = message[kNIMChatRoomMsgKeyAntiSpamEnable].asInt() == 1;
447  anti_spam_content_ = message[kNIMChatRoomMsgKeyAntiSpamContent].asString();
448  high_priority_ = message[kNIMChatRoomMsgKeyHighPriorityFlag].asInt();
449  if (message.isMember(kNIMChatRoomMsgKeyYiDunAntiCheating))
450  yidun_anti_cheating_ = message[kNIMChatRoomMsgKeyYiDunAntiCheating].asString();
451  if (message.isMember(kNIMChatRoomMsgKeyEnvConfig))
452  env_config_ = message[kNIMChatRoomMsgKeyEnvConfig].asString();
453  if (message.isMember(kNIMChatRoomMsgKeyAntiSpamExt))
454  anti_spam_ext_ = message[kNIMChatRoomMsgKeyAntiSpamExt].asString();
455  }
456 };
457 
459 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomMessage {
460 public:
461  int64_t room_id_;
462  std::string from_id_;
463  int64_t timetag_;
464  NIMChatRoomClientType from_client_type_;
465  std::string from_nick_;
466  std::string from_avatar_;
467  std::string from_ext_;
468  // v7.8 <--
470  // --> v7.8
471  // v8.4.0 <--
472  std::string notify_tags_;
473  // --> v8.4.0
474  std::string anti_spam_res_;
476 public:
477  NIMChatRoomMsgType msg_type_;
478  std::string msg_attach_;
479  std::string client_msg_id_;
480  std::string msg_body_;
482  // v7.8 <--
483  int32_t sub_type_;
484  // --> v7.8
485 public:
486  std::string local_res_path_;
487  std::string local_res_id_;
491  : room_id_(-1)
492  , from_client_type_(kNIMChatRoomClientTypeDefault)
493  , timetag_(0)
494  , third_party_callback_ext_("")
495  , sub_type_(0) {}
496 
502  void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value& values) {
503  room_id_ = values[kNIMChatRoomMsgKeyRoomID].asUInt64();
504  from_id_ = values[kNIMChatRoomMsgKeyFromAccount].asString();
505  timetag_ = values[kNIMChatRoomMsgKeyTime].asUInt64();
506  from_client_type_ = (NIMChatRoomClientType)values[kNIMChatRoomMsgKeyFromClientType].asUInt();
507  from_nick_ = values[kNIMChatRoomMsgKeyFromNick].asString();
508  from_avatar_ = values[kNIMChatRoomMsgKeyFromAvatar].asString();
509  from_ext_ = values[kNIMChatRoomMsgKeyFromExt].asString();
510  msg_type_ = (NIMChatRoomMsgType)values[kNIMChatRoomMsgKeyType].asUInt();
511  msg_attach_ = values[kNIMChatRoomMsgKeyAttach].asString();
512  client_msg_id_ = values[kNIMChatRoomMsgKeyClientMsgid].asString();
513  local_res_path_ = values[kNIMChatRoomMsgKeyLocalFilePath].asString();
514  local_res_id_ = values[kNIMChatRoomMsgKeyLocalResId].asString();
515  msg_body_ = values[kNIMChatRoomMsgKeyBody].asString();
516  msg_setting_.ParseMessageSetting(values);
517  if (values.isMember(kNIMChatRoomMsgKeyThirdPartyCBEXT))
518  third_party_callback_ext_ = values[kNIMChatRoomMsgKeyThirdPartyCBEXT].asString();
519  if (values.isMember(kNIMChatRoomMsgKeySubType))
520  sub_type_ = values[kNIMChatRoomMsgKeySubType].asInt();
521  if (values.isMember(kNIMChatRoomMsgKeyNotifyTags))
522  notify_tags_ = values[kNIMChatRoomMsgKeyNotifyTags].asString();
523  if (values.isMember(kNIMChatRoomMsgKeyAntiSpamRes))
524  anti_spam_res_ = values[kNIMChatRoomMsgKeyAntiSpamRes].asString();
525  }
526 
531  std::string ToJsonString() const {
532  nim_cpp_wrapper_util::Json::Value values;
533  values[kNIMChatRoomMsgKeyType] = msg_type_;
534  values[kNIMChatRoomMsgKeyTime] = timetag_;
535  values[kNIMChatRoomMsgKeyAttach] = msg_attach_;
536  values[kNIMChatRoomMsgKeyClientMsgid] = client_msg_id_;
537  values[kNIMChatRoomMsgKeyLocalFilePath] = local_res_path_;
538  values[kNIMChatRoomMsgKeyLocalResId] = local_res_id_;
539  values[kNIMChatRoomMsgKeyBody] = msg_body_;
540  values[kNIMChatRoomMsgKeyThirdPartyCBEXT] = third_party_callback_ext_;
541  values[kNIMChatRoomMsgKeySubType] = sub_type_;
542  values[kNIMChatRoomMsgKeyAntiSpamRes] = anti_spam_res_;
543  msg_setting_.ToJsonValue(values);
544  return nim::GetJsonStringWithNoStyled(values);
545  }
546 };
547 
549 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomGetMembersParameters {
550  NIMChatRoomGetMemberType type_;
552  int limit_;
556  : timestamp_offset_(0)
557  , limit_(0) {}
558 
563  std::string ToJsonString() const {
564  nim_cpp_wrapper_util::Json::Value values;
565  values[kNIMChatRoomGetMembersKeyType] = type_;
566  values[kNIMChatRoomGetMembersKeyOffset] = timestamp_offset_;
567  values[kNIMChatRoomGetMembersKeyLimit] = limit_;
568  return nim::GetJsonStringWithNoStyled(values);
569  }
570 };
571 
573 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomGetMembersByTagParameters {
574  std::string tag_;
576  int limit_;
580  : timestamp_offset_(0)
581  , limit_(0) {}
582 
587  std::string ToJsonString() const {
588  nim_cpp_wrapper_util::Json::Value values;
589  values[kNIMChatRoomGetMembersKeyTag] = tag_;
590  values[kNIMChatRoomGetMembersKeyOffset] = timestamp_offset_;
591  values[kNIMChatRoomGetMembersKeyLimit] = limit_;
592  return nim::GetJsonStringWithNoStyled(values);
593  }
594 };
595 
597 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomGetMsgHistoryParameters {
598  int64_t start_timetag_;
599  int limit_;
600  bool reverse_;
601  std::vector<NIMChatRoomMsgType> msg_types_;
604  : start_timetag_(0)
605  , limit_(0)
606  , reverse_(false) {
607  if (kMsg_Types_List.empty()) {
608  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeText);
609  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeImage);
610  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeAudio);
611  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeVideo);
612  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeLocation);
613  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeNotification);
614  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeFile);
615  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeRobot);
616  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeTips);
617  kMsg_Types_List.emplace_back(kNIMChatRoomMsgTypeCustom);
618  }
619  msg_types_.assign(kMsg_Types_List.begin(), kMsg_Types_List.end());
620  }
621  // 考虑到兼容以前版本,只提供删除类型接口,如果所有类型都被删除,会添加Unknown类型以区别之前的版本
622  void RemoveMessageType(NIMChatRoomMsgType type) {
623  auto it = std::find_if(msg_types_.begin(), msg_types_.end(), [&](const NIMChatRoomMsgType& item) {
624  return item == type;
625  });
626  if (it != msg_types_.end())
627  msg_types_.erase(it);
628  if (msg_types_.empty())
629  msg_types_.emplace_back(kNIMChatRoomMsgTypeUnknown);
630  }
635  std::string ToJsonString() const {
636  nim_cpp_wrapper_util::Json::Value values;
637  values[kNIMChatRoomGetMsgHistoryKeyStartTime] = start_timetag_;
638  values[kNIMChatRoomGetMsgHistoryKeyLimit] = limit_;
639  values[kNIMChatRoomGetMsgHistoryKeyReverse] = reverse_;
640  auto it = msg_types_.begin();
641  while (it != msg_types_.end()) {
642  values[kNIMChatRoomGetMsgHistoryKeyMsgtypes].append(nim_cpp_wrapper_util::Json::Value(*it));
643  it++;
644  }
645  return nim::GetJsonStringWithNoStyled(values);
646  }
647 
648 private:
649  static std::vector<NIMChatRoomMsgType> kMsg_Types_List;
650 };
651 
653 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomSetMemberAttributeParameters {
654  std::string account_id_;
655  NIMChatRoomMemberAttribute attribute_;
656  bool opt_;
657  std::string notify_ext_;
661  : level_(0) {}
662 
667  std::string ToJsonString() const {
668  nim_cpp_wrapper_util::Json::Value values;
669  values[kNIMChatRoomSetMemberAttributeKeyAccoutID] = account_id_;
670  values[kNIMChatRoomSetMemberAttributeKeyAttribute] = attribute_;
671  values[kNIMChatRoomSetMemberAttributeKeyOpt] = opt_;
672  values[kNIMChatRoomSetMemberAttributeKeyNotifyExt] = notify_ext_;
673  return nim::GetJsonStringWithNoStyled(values);
674  }
675 
676 private:
677  int level_;
678 };
679 
681 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomMemberInfo {
682  int64_t room_id_;
683  std::string account_id_;
684  std::string tags_;
685  int type_;
686  int level_;
687  std::string nick_;
688  std::string avatar_;
689  std::string ext_;
690  std::string notify_tags_;
691  NIMChatRoomOnlineState state_;
692  NIMChatRoomGuestFlag guest_flag_;
693  int64_t enter_timetag_;
695  bool is_muted_;
696  bool is_valid_;
697  int64_t update_timetag_;
698  bool temp_muted_;
702  : room_id_(0)
703  , type_(-2)
704  , level_(0)
705  , state_(kNIMChatRoomOnlineStateOffline)
706  , guest_flag_(kNIMChatRoomGuestFlagGuest)
707  , enter_timetag_(0)
708  , is_blacklist_(false)
709  , is_muted_(false)
710  , is_valid_(false)
711  , update_timetag_(0)
712  , temp_muted_(false)
713  , temp_muted_duration_(0) {}
714 
716  void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value& value) {
717  if (value.isMember(kNIMChatRoomMemberInfoKeyRoomID))
718  room_id_ = value[kNIMChatRoomMemberInfoKeyRoomID].asUInt64();
719  if (value.isMember(kNIMChatRoomMemberInfoKeyAccID))
720  account_id_ = value[kNIMChatRoomMemberInfoKeyAccID].asString();
721  if (value.isMember(kNIMChatRoomMemberInfoKeyType))
722  type_ = value[kNIMChatRoomMemberInfoKeyType].asInt();
723  if (value.isMember(kNIMChatRoomMemberInfoKeyLevel))
724  level_ = value[kNIMChatRoomMemberInfoKeyLevel].asInt();
725  if (value.isMember(kNIMChatRoomMemberInfoKeyNick))
726  nick_ = value[kNIMChatRoomMemberInfoKeyNick].asString();
727  if (value.isMember(kNIMChatRoomMemberInfoKeyAvatar))
728  avatar_ = value[kNIMChatRoomMemberInfoKeyAvatar].asString();
729  if (value.isMember(kNIMChatRoomMemberInfoKeyExt))
730  ext_ = value[kNIMChatRoomMemberInfoKeyExt].asString();
731  if (value.isMember(kNIMChatRoomMemberInfoKeyOnlineState))
732  state_ = (NIMChatRoomOnlineState)value[kNIMChatRoomMemberInfoKeyOnlineState].asInt();
733  if (value.isMember(kNIMChatRoomMemberInfoKeyGuestFlag))
734  guest_flag_ = (NIMChatRoomGuestFlag)value[kNIMChatRoomMemberInfoKeyGuestFlag].asInt();
735  if (value.isMember(kNIMChatRoomMemberInfoKeyEnterTimetag))
736  enter_timetag_ = value[kNIMChatRoomMemberInfoKeyEnterTimetag].asUInt64();
737  if (value.isMember(kNIMChatRoomMemberInfoKeyBlacklist))
738  is_blacklist_ = value[kNIMChatRoomMemberInfoKeyBlacklist].asInt() == 1;
739  if (value.isMember(kNIMChatRoomMemberInfoKeyMuted))
740  is_muted_ = value[kNIMChatRoomMemberInfoKeyMuted].asInt() == 1;
741  if (value.isMember(kNIMChatRoomMemberInfoKeyValid))
742  is_valid_ = value[kNIMChatRoomMemberInfoKeyValid].asInt() == 1;
743  if (value.isMember(kNIMChatRoomMemberInfoKeyUpdateTimetag))
744  update_timetag_ = value[kNIMChatRoomMemberInfoKeyUpdateTimetag].asUInt64();
745  if (value.isMember(kNIMChatRoomMemberInfoKeyTempMute))
746  temp_muted_ = value[kNIMChatRoomMemberInfoKeyTempMute].asInt() == 1;
747  if (value.isMember(kNIMChatRoomMemberInfoKeyTempMuteRestDuration))
748  temp_muted_duration_ = value[kNIMChatRoomMemberInfoKeyTempMuteRestDuration].asInt64();
749  if (value.isMember(kNIMChatRoomMemberInfoKeyTag))
750  tags_ = value[kNIMChatRoomMemberInfoKeyTag].asString();
751  if (value.isMember(kNIMChatRoomMemberInfoKeyNotifyTags))
752  notify_tags_ = value[kNIMChatRoomMemberInfoKeyNotifyTags].asString();
753  }
754 
759  std::string ToJsonString() const {
760  nim_cpp_wrapper_util::Json::Value values;
761  values[kNIMChatRoomMemberInfoKeyRoomID] = room_id_;
762  values[kNIMChatRoomMemberInfoKeyAccID] = account_id_;
763  values[kNIMChatRoomMemberInfoKeyType] = type_;
764  values[kNIMChatRoomMemberInfoKeyLevel] = level_;
765  values[kNIMChatRoomMemberInfoKeyNick] = nick_;
766  values[kNIMChatRoomMemberInfoKeyAvatar] = avatar_;
767  values[kNIMChatRoomMemberInfoKeyExt] = ext_;
768  values[kNIMChatRoomMemberInfoKeyOnlineState] = state_;
769  values[kNIMChatRoomMemberInfoKeyGuestFlag] = guest_flag_;
770  values[kNIMChatRoomMemberInfoKeyEnterTimetag] = enter_timetag_;
771  values[kNIMChatRoomMemberInfoKeyBlacklist] = is_blacklist_ ? 1 : 0;
772  values[kNIMChatRoomMemberInfoKeyMuted] = is_muted_ ? 1 : 0;
773  values[kNIMChatRoomMemberInfoKeyValid] = is_valid_ ? 1 : 0;
774  values[kNIMChatRoomMemberInfoKeyUpdateTimetag] = update_timetag_;
775  values[kNIMChatRoomMemberInfoKeyTempMute] = temp_muted_ ? 1 : 0;
776  values[kNIMChatRoomMemberInfoKeyTempMuteRestDuration] = temp_muted_duration_;
777  return nim::GetJsonStringWithNoStyled(values);
778  }
779 };
780 
782 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomQueueElement {
783  std::string key_;
784  std::string value_;
785 };
786 
788 typedef std::list<ChatRoomQueueElement> ChatRoomQueue;
789 
791 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API NIMChatRoomExitReasonInfo {
792  std::string notify_ext_;
793  NIMChatRoomExitReason code_;
794  operator NIMChatRoomExitReason() const { return code_; }
795 };
796 
798 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool operator==(const NIMChatRoomExitReasonInfo& info, NIMChatRoomExitReason code);
799 
807 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseChatRoomEnterCallbackResultInfo(const std::string& result,
808  ChatRoomInfo& room_info,
809  ChatRoomMemberInfo& my_info);
810 
817 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseChatRoomMemberInfos(const std::string& infos_json_str, std::list<ChatRoomMemberInfo>& infos);
818 
825 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseChatRoomMsgs(const std::string& msgs_json_str, std::list<ChatRoomMessage>& msgs);
826 
828 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API RobotInfo {
829 public:
831  void SetAccid(const std::string& accid) { robot_info_[kNIMRobotInfoKeyAccid] = accid; }
832 
834  std::string GetAccid() const { return robot_info_[kNIMRobotInfoKeyAccid].asString(); }
835 
837  void SetName(const std::string& name) { robot_info_[kNIMRobotInfoKeyName] = name; }
838 
840  std::string GetName() const { return robot_info_[kNIMRobotInfoKeyName].asString(); }
841 
843  void SetIcon(const std::string& icon) { robot_info_[kNIMRobotInfoKeyIcon] = icon; }
844 
846  std::string GetIcon() const { return robot_info_[kNIMRobotInfoKeyIcon].asString(); }
847 
849  void SetIntro(const std::string& intro) { robot_info_[kNIMRobotInfoKeyIntro] = intro; }
850 
852  std::string GetIntro() const { return robot_info_[kNIMRobotInfoKeyIntro].asString(); }
853 
855  void SetRobotID(const std::string& id) { robot_info_[kNIMRobotInfoKeyRobotId] = id; }
856 
858  std::string GetRobotID() const { return robot_info_[kNIMRobotInfoKeyRobotId].asString(); }
859 
861  void SetCreateTime(const uint64_t time) { robot_info_[kNIMRobotInfoKeyCreateTime] = time; }
862 
864  uint64_t GetCreateTime() const { return robot_info_[kNIMRobotInfoKeyCreateTime].asUInt64(); }
865 
867  void SetUpdateTime(const uint64_t time) { robot_info_[kNIMRobotInfoKeyUpdateTime] = time; }
868 
870  uint64_t GetUpdateTime() const { return robot_info_[kNIMRobotInfoKeyUpdateTime].asUInt64(); }
871 
872 private:
873  nim_cpp_wrapper_util::Json::Value robot_info_;
874 };
875 
877 typedef std::list<RobotInfo> RobotInfos;
878 
885 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfosStringToRobotInfos(const std::string& infos_json, RobotInfos& infos);
886 
893 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfoStringToRobotInfo(const std::string& info_json, RobotInfo& info);
894 
897 struct NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API ChatRoomBatchMembers {
898  std::map<std::string, std::string> members_values_;
900  ChatRoomBatchMembers() { members_values_.clear(); }
901  explicit ChatRoomBatchMembers(const std::map<std::string, std::string>& members)
902  : members_values_(members) {}
903 
904  void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value& json_str) { assert(false); }
905 
910  std::string ToJsonString() const {
911  nim_cpp_wrapper_util::Json::Value values;
912  int i = 0;
913  for (auto it = members_values_.begin(); it != members_values_.end(); ++it) {
914  values[i][kNIMChatRoomQueueElementKey] = it->first.c_str();
915  values[i][kNIMChatRoomQueueElementValue] = it->second.c_str();
916  i++;
917  }
918  return nim::GetJsonStringWithNoStyled(values);
919  }
920 };
921 
928 NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseBatchInfosStringToNotMembers(const std::string& infos_json, std::list<std::string>& lst_members);
929 
930 } // namespace nim_chatroom
931 
932 #endif //_NIM_CHATROOM_SDK_CPP_HELPER_H_
聊天室
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfoStringToRobotInfo(const std::string &info_json, RobotInfo &info)
解析机器人信息
std::list< ChatRoomQueueElement > ChatRoomQueue
聊天室麦序队列
Definition: nim_chatroom_helper.h:788
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseBatchInfosStringToNotMembers(const std::string &infos_json, std::list< std::string > &lst_members)
解析成员列表
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseChatRoomMemberInfos(const std::string &infos_json_str, std::list< ChatRoomMemberInfo > &infos)
解析聊天室成员信息
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseChatRoomEnterCallbackResultInfo(const std::string &result, ChatRoomInfo &room_info, ChatRoomMemberInfo &my_info)
解析聊天室登录结果
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseChatRoomMsgs(const std::string &msgs_json_str, std::list< ChatRoomMessage > &msgs)
解析聊天室成员信息
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool ParseRobotInfosStringToRobotInfos(const std::string &infos_json, RobotInfos &infos)
解析机器人信息
NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API bool operator==(const NIMChatRoomExitReasonInfo &info, NIMChatRoomExitReason code)
Definition: nim_chatroom_helper.h:125
std::string app_key_
Definition: nim_chatroom_helper.h:132
std::list< std::string > address_
Definition: nim_chatroom_helper.h:126
std::list< std::string > login_tags_
Definition: nim_chatroom_helper.h:134
std::string notify_tags_
Definition: nim_chatroom_helper.h:135
std::string app_data_file_
Definition: nim_chatroom_helper.h:128
bool random_id_
Definition: nim_chatroom_helper.h:133
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:146
int sdk_log_level_
Definition: nim_chatroom_helper.h:131
聊天室批量更新成员
Definition: nim_chatroom_helper.h:897
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:910
ChatRoomBatchMembers()
Definition: nim_chatroom_helper.h:900
聊天室登录信息
Definition: nim_chatroom_helper.h:31
void SetNotifyExt(const nim_cpp_wrapper_util::Json::Value &notify_ext)
设置进入聊天室通知开发者扩展字段,选填
Definition: nim_chatroom_helper.h:58
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:84
void SetNick(const std::string &nick)
设置进入聊天室后展示的昵称,选填
Definition: nim_chatroom_helper.h:37
void SetExt(const nim_cpp_wrapper_util::Json::Value &ext)
设置聊天室可用的扩展字段,选填
Definition: nim_chatroom_helper.h:51
void SetNotifyTags(const std::string &expression)
登录时携带的 notify tag 表达式
Definition: nim_chatroom_helper.h:78
void SetLoginTag(const std::list< std::string > &login_tags)
设置登录携带的 tag 列表,允许多个
Definition: nim_chatroom_helper.h:67
void SetAvatar(const std::string &avatar)
设置进入聊天室后展示的头像,选填
Definition: nim_chatroom_helper.h:44
根据 tag 获取聊天室成员参数
Definition: nim_chatroom_helper.h:573
int limit_
Definition: nim_chatroom_helper.h:576
std::string tag_
Definition: nim_chatroom_helper.h:574
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:587
int64_t timestamp_offset_
Definition: nim_chatroom_helper.h:575
ChatRoomGetMembersByTagParameters()
Definition: nim_chatroom_helper.h:579
获取聊天室成员参数
Definition: nim_chatroom_helper.h:549
int64_t timestamp_offset_
Definition: nim_chatroom_helper.h:551
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:563
ChatRoomGetMembersParameters()
Definition: nim_chatroom_helper.h:555
NIMChatRoomGetMemberType type_
Definition: nim_chatroom_helper.h:550
int limit_
Definition: nim_chatroom_helper.h:552
获取聊天室消息历史参数
Definition: nim_chatroom_helper.h:597
int limit_
Definition: nim_chatroom_helper.h:599
ChatRoomGetMsgHistoryParameters()
Definition: nim_chatroom_helper.h:603
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:635
int64_t start_timetag_
Definition: nim_chatroom_helper.h:598
bool reverse_
Definition: nim_chatroom_helper.h:600
std::vector< NIMChatRoomMsgType > msg_types_
Definition: nim_chatroom_helper.h:601
Definition: nim_chatroom_helper.h:90
std::list< std::string > address_
Definition: nim_chatroom_helper.h:91
std::list< std::string > login_tags_
Definition: nim_chatroom_helper.h:97
std::string app_data_file_
Definition: nim_chatroom_helper.h:92
std::string token_
Definition: nim_chatroom_helper.h:96
std::string accid_
Definition: nim_chatroom_helper.h:95
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:106
int sdk_log_level_
Definition: nim_chatroom_helper.h:93
std::string app_key_
Definition: nim_chatroom_helper.h:94
std::string notify_tags_
Definition: nim_chatroom_helper.h:98
聊天室信息
Definition: nim_chatroom_helper.h:165
int queuelevel
Definition: nim_chatroom_helper.h:175
int online_count_
Definition: nim_chatroom_helper.h:173
ChatRoomInfo()
Definition: nim_chatroom_helper.h:177
std::string announcement_
Definition: nim_chatroom_helper.h:168
std::string ext_
Definition: nim_chatroom_helper.h:172
int64_t id_
Definition: nim_chatroom_helper.h:166
std::string name_
Definition: nim_chatroom_helper.h:167
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:205
std::string broadcast_url_
Definition: nim_chatroom_helper.h:169
int valid_flag_
Definition: nim_chatroom_helper.h:171
int mute_all_
Definition: nim_chatroom_helper.h:174
void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
从JsonValue中解析得到聊天室信息
Definition: nim_chatroom_helper.h:188
std::string creator_id_
Definition: nim_chatroom_helper.h:170
聊天室成员信息
Definition: nim_chatroom_helper.h:681
std::string account_id_
Definition: nim_chatroom_helper.h:683
int64_t enter_timetag_
Definition: nim_chatroom_helper.h:693
bool is_muted_
Definition: nim_chatroom_helper.h:695
std::string avatar_
Definition: nim_chatroom_helper.h:688
bool temp_muted_
Definition: nim_chatroom_helper.h:698
int64_t room_id_
Definition: nim_chatroom_helper.h:682
void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value &value)
Definition: nim_chatroom_helper.h:716
bool is_blacklist_
Definition: nim_chatroom_helper.h:694
NIMChatRoomOnlineState state_
Definition: nim_chatroom_helper.h:691
std::string nick_
Definition: nim_chatroom_helper.h:687
int type_
Definition: nim_chatroom_helper.h:685
NIMChatRoomGuestFlag guest_flag_
Definition: nim_chatroom_helper.h:692
std::string ext_
Definition: nim_chatroom_helper.h:689
int64_t temp_muted_duration_
Definition: nim_chatroom_helper.h:699
std::string tags_
Definition: nim_chatroom_helper.h:684
std::string notify_tags_
Definition: nim_chatroom_helper.h:690
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:759
ChatRoomMemberInfo()
Definition: nim_chatroom_helper.h:701
int level_
Definition: nim_chatroom_helper.h:686
int64_t update_timetag_
Definition: nim_chatroom_helper.h:697
bool is_valid_
Definition: nim_chatroom_helper.h:696
聊天室消息
Definition: nim_chatroom_helper.h:459
int64_t timetag_
Definition: nim_chatroom_helper.h:463
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:531
std::string msg_body_
Definition: nim_chatroom_helper.h:480
std::string from_ext_
Definition: nim_chatroom_helper.h:467
ChatRoomMessage()
Definition: nim_chatroom_helper.h:490
std::string from_id_
Definition: nim_chatroom_helper.h:462
void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
从JsonValue中解析得到聊天室消息
Definition: nim_chatroom_helper.h:502
NIMChatRoomMsgType msg_type_
Definition: nim_chatroom_helper.h:477
std::string local_res_id_
Definition: nim_chatroom_helper.h:487
int64_t room_id_
Definition: nim_chatroom_helper.h:461
int32_t sub_type_
Definition: nim_chatroom_helper.h:483
std::string msg_attach_
Definition: nim_chatroom_helper.h:478
NIMChatRoomClientType from_client_type_
Definition: nim_chatroom_helper.h:464
ChatRoomMessageSetting msg_setting_
Definition: nim_chatroom_helper.h:481
std::string notify_tags_
Definition: nim_chatroom_helper.h:472
std::string anti_spam_res_
Definition: nim_chatroom_helper.h:474
std::string client_msg_id_
Definition: nim_chatroom_helper.h:479
std::string local_res_path_
Definition: nim_chatroom_helper.h:486
std::string third_party_callback_ext_
Definition: nim_chatroom_helper.h:469
std::string from_nick_
Definition: nim_chatroom_helper.h:465
std::string from_avatar_
Definition: nim_chatroom_helper.h:466
聊天室消息属性设置
Definition: nim_chatroom_helper.h:391
bool history_save_
Definition: nim_chatroom_helper.h:396
int anti_spam_using_yidun_
Definition: nim_chatroom_helper.h:398
std::string anti_spam_bizid_
Definition: nim_chatroom_helper.h:397
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &message) const
组装Json Value字符串
Definition: nim_chatroom_helper.h:420
std::string anti_spam_ext_
Definition: nim_chatroom_helper.h:403
std::string yidun_anti_cheating_
Definition: nim_chatroom_helper.h:401
int high_priority_
Definition: nim_chatroom_helper.h:400
bool anti_spam_enable_
Definition: nim_chatroom_helper.h:394
void ParseMessageSetting(const nim_cpp_wrapper_util::Json::Value &message)
从Json Value解析出消息属性设置
Definition: nim_chatroom_helper.h:442
std::string anti_spam_content_
Definition: nim_chatroom_helper.h:395
bool resend_flag_
Definition: nim_chatroom_helper.h:392
std::string ext_
Definition: nim_chatroom_helper.h:393
ChatRoomMessageSetting()
Definition: nim_chatroom_helper.h:405
std::string env_config_
Definition: nim_chatroom_helper.h:402
聊天室通知
Definition: nim_chatroom_helper.h:222
std::string target_tag_
Definition: nim_chatroom_helper.h:236
bool temp_muted_
Definition: nim_chatroom_helper.h:232
std::string operator_id_
Definition: nim_chatroom_helper.h:225
std::list< std::string > target_nick_
Definition: nim_chatroom_helper.h:227
NIMChatRoomNotificationId id_
Definition: nim_chatroom_helper.h:223
std::string queue_change_
Definition: nim_chatroom_helper.h:233
std::string operator_nick_
Definition: nim_chatroom_helper.h:226
std::string msg_id_
Definition: nim_chatroom_helper.h:239
int64_t temp_mute_duration_
Definition: nim_chatroom_helper.h:229
uint64_t msg_timetag_
Definition: nim_chatroom_helper.h:240
ChatRoomNotification()
Definition: nim_chatroom_helper.h:243
std::list< std::string > target_ids_
Definition: nim_chatroom_helper.h:228
std::string ext_
Definition: nim_chatroom_helper.h:224
void ParseFromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
从JsonValue中解析得到聊天室通知
Definition: nim_chatroom_helper.h:254
bool muted_
Definition: nim_chatroom_helper.h:231
通知麦序队列中有批量变更,发生在元素提交者离开聊天室或者从聊天室异常掉线时
Definition: nim_chatroom_helper.h:358
std::string value_
Definition: nim_chatroom_helper.h:361
std::string type_
Definition: nim_chatroom_helper.h:359
std::string key_
Definition: nim_chatroom_helper.h:360
void ParseFromNotification(const ChatRoomNotification &notification)
从聊天室通知中解析得到队列变更具体内容
Definition: nim_chatroom_helper.h:369
std::map< std::string, std::string > changed_values_
Definition: nim_chatroom_helper.h:362
聊天室队列通知内容
Definition: nim_chatroom_helper.h:336
std::string value_
Definition: nim_chatroom_helper.h:339
void ParseFromNotification(const ChatRoomNotification &notification)
从聊天室通知中解析得到队列变更具体内容
Definition: nim_chatroom_helper.h:346
std::string type_
Definition: nim_chatroom_helper.h:337
std::string key_
Definition: nim_chatroom_helper.h:338
聊天室麦序队列元素
Definition: nim_chatroom_helper.h:782
std::string value_
Definition: nim_chatroom_helper.h:784
std::string key_
Definition: nim_chatroom_helper.h:783
聊天室麦序添加、更新选项
Definition: nim_chatroom_helper.h:319
std::string element_accid_
Definition: nim_chatroom_helper.h:322
bool transient_
Definition: nim_chatroom_helper.h:321
设置聊天室成员身份标识参数
Definition: nim_chatroom_helper.h:653
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_chatroom_helper.h:667
bool opt_
Definition: nim_chatroom_helper.h:656
std::string account_id_
Definition: nim_chatroom_helper.h:654
std::string notify_ext_
Definition: nim_chatroom_helper.h:657
ChatRoomSetMemberAttributeParameters()
Definition: nim_chatroom_helper.h:660
NIMChatRoomMemberAttribute attribute_
Definition: nim_chatroom_helper.h:655
聊天室退出时的信息
Definition: nim_chatroom_helper.h:791
NIMChatRoomExitReason code_
Definition: nim_chatroom_helper.h:793
std::string notify_ext_
Definition: nim_chatroom_helper.h:792
机器人信息
Definition: nim_chatroom_helper.h:828
std::string GetRobotID() const
Definition: nim_chatroom_helper.h:858
void SetName(const std::string &name)
Definition: nim_chatroom_helper.h:837
std::string GetName() const
Definition: nim_chatroom_helper.h:840
void SetIcon(const std::string &icon)
Definition: nim_chatroom_helper.h:843
void SetIntro(const std::string &intro)
Definition: nim_chatroom_helper.h:849
void SetUpdateTime(const uint64_t time)
Definition: nim_chatroom_helper.h:867
std::string GetIntro() const
Definition: nim_chatroom_helper.h:852
void SetRobotID(const std::string &id)
Definition: nim_chatroom_helper.h:855
std::string GetIcon() const
Definition: nim_chatroom_helper.h:846
void SetAccid(const std::string &accid)
Definition: nim_chatroom_helper.h:831
std::string GetAccid() const
Definition: nim_chatroom_helper.h:834
uint64_t GetCreateTime() const
Definition: nim_chatroom_helper.h:864
uint64_t GetUpdateTime() const
Definition: nim_chatroom_helper.h:870
void SetCreateTime(const uint64_t time)
Definition: nim_chatroom_helper.h:861