7#ifndef _NIM_SDK_CPP_TEAM_HELPER_H_
8#define _NIM_SDK_CPP_TEAM_HELPER_H_
48 SetLevel(new_info.GetLevel());
248 return (
NIMTeamMuteType)team_info_json_value_[nim::kNIMTeamInfoKeyMuteType].asUInt();
256 bool ExistValue(
const std::string& nim_team_info_key)
const {
return team_info_json_value_.isMember(nim_team_info_key); }
360 bool ExistValue(
const std::string& nim_team_user_key)
const {
return member_info_json_value_.isMember(nim_team_user_key); }
415 const std::string& team_id,
417 const std::string& team_event_json,
442NIM_SDK_CPPWRAPPER_DLL_API
bool ParseTeamInfosJson(
const std::string& team_infos_json, std::list<TeamInfo>& team_infos);
468 std::list<TeamMemberProperty>& team_member_propertys);
Represents a JSON value.
Definition: value.h:196
void ParseTeamEvent(int rescode, const std::string &team_id, const NIMNotificationId notification_id, const std::string &team_event_json, TeamEvent &team_event)
解析群组事件通知
Definition: nim_team_helper.cpp:11
bool ParseTeamInfosJson(const std::string &team_infos_json, std::list< TeamInfo > &team_infos)
解析群组信息
Definition: nim_team_helper.cpp:158
void ParseTeamMemberPropertyJson(const nim_cpp_wrapper_util::Json::Value &team_member_prop_json, TeamMemberProperty &team_member_property)
解析群成员信息
Definition: nim_team_helper.cpp:173
void ParseTeamInfoJson(const nim_cpp_wrapper_util::Json::Value &team_info_json, TeamInfo &team_info)
解析群组信息
Definition: nim_team_helper.cpp:116
bool ParseTeamMemberPropertysJson(const std::string &team_member_props_json, std::list< TeamMemberProperty > &team_member_propertys)
解析群成员信息
Definition: nim_team_helper.cpp:200
std::string GetJsonStringWithNoStyled(const nim_cpp_wrapper_util::Json::Value &values)
获得非格式化的Json string,传入SDK的json string格式要求为非格式化的,如果是格式化的json string可能会影响功能
Definition: nim_json_util.cpp:89
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
NIMNotificationId
Definition: nim_msglog_def.h:338
static const char * kNIMTeamUserKeyBits
long,群成员属性,位操作(NIMTeamBitsConfigMask)
Definition: nim_team_def.h:313
static const char * kNIMTeamInfoKeyType
int,群类型(NIMTeamType)
Definition: nim_team_def.h:223
static const char * kNIMTeamInfoKeyUpdateTime
long,群信息上次更新时间戳(毫秒),通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:241
NIMTeamBeInviteMode
Definition: nim_team_def.h:174
static const char * kNIMTeamUserKeyUpdateTime
long,群成员信息上次更新时间戳(毫秒),通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:319
static const char * kNIMTeamInfoKeyProperty
string,群性质,长度限制:6000字符
Definition: nim_team_def.h:231
static const char * kNIMTeamInfoKeyListTime
long,群列表时间戳(毫秒),通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:237
static const char * kNIMTeamInfoKeyMemberValid
int,群有效性标记位,客户端用,有效1,无效0,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:243
static const char * kNIMTeamInfoKeyCreator
string 群拥有者ID,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:225
static const char * kNIMTeamInfoKeyUpdateInfoMode
int, 谁可以修改群资料,属性本身只有群主管理员可以修改,默认kNIMTeamUpdateInfoModeManager(0)/kNIMTeamUpdateInfoModeEveryone(1)
Definition: nim_team_def.h:263
static const char * kNIMTeamUserKeyType
int,群成员类型(NIMTeamUserType),默认kNIMTeamUserTypeNomal(0)
Definition: nim_team_def.h:309
static const char * kNIMTeamInfoKeyLevel
int,■■已废弃■■ 群等级,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:227
NIMTeamType
Definition: nim_team_def.h:294
static const char * kNIMTeamUserKeyNick
string,群成员昵称
Definition: nim_team_def.h:311
static const char * kNIMTeamInfoKeyName
string,群名称
Definition: nim_team_def.h:221
NIMTeamMuteType
Definition: nim_team_def.h:274
@ kNIMTeamMuteTypeNomalMute
普通成员禁言
Definition: nim_team_def.h:278
static const char * kNIMTeamInfoKeyCustom
string, 第三方扩展字段(仅负责存储和透传)
Definition: nim_team_def.h:253
static const char * kNIMTeamInfoKeyBeInviteMode
int, 被邀请人同意方式,属性本身只有群主管理员可以修改,默认kNIMTeamBeInviteModeNeedAgree(0)/kNIMTeamBeInviteModeNotNeedAgree(1)
Definition: nim_team_def.h:259
static const char * kNIMTeamUserKeyID
string,群id,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:305
static const char * kNIMTeamUserKeyCustom
string,群成员自定义扩展字段,必须为可以解析为json的非格式化的字符串
Definition: nim_team_def.h:321
static const char * kNIMTeamInfoKeyJoinMode
int,入群模式(NIMTeamJoinMode),默认为kNIMTeamJoinModeNoAuth(0),不需要验证
Definition: nim_team_def.h:249
static const char * kNIMTeamInfoKeyID
string,群id,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:219
NIMTeamJoinMode
Definition: nim_team_def.h:343
static const char * kNIMTeamInfoKeyAnnouncement
string,群公告,长度限制:5000字符
Definition: nim_team_def.h:247
static const char * kNIMTeamInfoKeyMemberMaxCount
int,在创建群时,设置群的最大成员数,不可超过应用设定的最大成员数,否则返回414
Definition: nim_team_def.h:229
static const char * kNIMTeamUserKeyCreateTime
long,入群时间戳(毫秒),通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:317
NIMTeamUpdateCustomMode
Definition: nim_team_def.h:198
static const char * kNIMTeamUserKeyInvitorAccID
string,邀请者的accid 主动入群的时为空,尚未进行过初始化为" "
Definition: nim_team_def.h:325
static const char * kNIMTeamInfoKeyServerCustom
string, 第三方服务器扩展字段(该配置项只能通过服务器接口设置,对客户端只读)
Definition: nim_team_def.h:255
NIMTeamInviteMode
Definition: nim_team_def.h:182
static const char * kNIMTeamInfoKeyValidFlag
int,群有效性标记位,有效1,无效0,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:233
static const char * kNIMTeamUserKeyValidFlag
int,群成员有效性标记位,有效1,无效0,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:315
static const char * kNIMTeamInfoKeyIcon
string, 群头像,长度限制:1024字符
Definition: nim_team_def.h:257
static const char * kNIMTeamInfoKeyIntro
string,群介绍,长度限制:255字符
Definition: nim_team_def.h:245
static const char * kNIMTeamInfoKeyUpdateCustomMode
int, 谁可以更新群自定义属性,属性本身只有群主管理员可以修改,默认kNIMTeamUpdateCustomModeManager(0)/kNIMTeamUpdateCustomModeEveryon...
Definition: nim_team_def.h:265
static const char * kNIMTeamInfoKeyCreateTime
long,群创建时间戳(毫秒),通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:239
NIMTeamUpdateInfoMode
Definition: nim_team_def.h:190
static const char * kNIMTeamUserKeyMute
int,是否被禁言,0-非禁言(默认),1-禁言
Definition: nim_team_def.h:323
static const char * kNIMTeamInfoKeyInviteMode
int, 谁可以邀请他人入群,属性本身只有群主管理员可以修改,默认kNIMTeamInviteModeManager(0)/kNIMTeamInviteModeEveryone(1)
Definition: nim_team_def.h:261
static const char * kNIMTeamUserKeyAccID
string,群成员id,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:307
static const char * kNIMTeamInfoKeyMemberCount
int,群成员数量,通常情况下由SDK维护,开发者作为只读无需设置
Definition: nim_team_def.h:235
NIMTeamUserType
Definition: nim_team_def.h:329
static const char * kNIMTeamInfoKeyMuteAll
int, 群全员禁言标记 0:未禁言,1:禁言, 开发者只读 无法设置
Definition: nim_team_def.h:267
群组事件通知
Definition: nim_team_helper.h:379
TeamMemberProperty member_property_
群成员属性
Definition: nim_team_helper.h:395
std::string attach_
扩展字段,目前仅kick和invite事件可选
Definition: nim_team_helper.h:399
bool opt_
操作
Definition: nim_team_helper.h:397
std::string team_id_
群组ID
Definition: nim_team_helper.h:385
nim_cpp_wrapper_util::Json::Value src_data_
未解析过的原信息,目前仅支持群消息未读数相关事件
Definition: nim_team_helper.h:401
std::list< UserNameCard > namecards_
通知可能涉及到的群成员的用户名片
Definition: nim_team_helper.h:391
TeamInfo team_info_
通知可能涉及到的群信息
Definition: nim_team_helper.h:393
std::list< std::string > ids_
通知可能涉及到的群成员ID
Definition: nim_team_helper.h:387
std::list< std::string > invalid_ids_
通知可能涉及到的失效的群成员ID,比如邀请入群的成员的群数量超限导致当次邀请失败
Definition: nim_team_helper.h:389
NIMNotificationId notification_id_
通知类型ID
Definition: nim_team_helper.h:383
NIMResCode res_code_
错误码
Definition: nim_team_helper.h:381
群组信息
Definition: nim_team_helper.h:24
nim::NIMTeamType GetType() const
Definition: nim_team_helper.h:109
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
获取JsonValue格式的数据
Definition: nim_team_helper.h:268
void SetServerCustom(const std::string &custom)
Definition: nim_team_helper.h:203
NIMTeamUpdateCustomMode GetUpdateCustomMode() const
Definition: nim_team_helper.h:238
void SetMute(NIMTeamMuteType mute_type)
Definition: nim_team_helper.h:242
TeamInfo(const std::string &team_id, const nim::NIMTeamType type)
Definition: nim_team_helper.h:27
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_team_helper.h:262
TeamInfo()
Definition: nim_team_helper.h:33
NIMTeamBeInviteMode GetBeInviteMode() const
Definition: nim_team_helper.h:218
void Update(const TeamInfo &new_info)
Definition: nim_team_helper.h:40
void operator=(const TeamInfo &new_info)
Definition: nim_team_helper.h:37
std::string GetTeamID() const
Definition: nim_team_helper.h:97
void SetMemberListTimetag(int64_t timetag)
Definition: nim_team_helper.h:143
void SetUpdateTimetag(int64_t timetag)
Definition: nim_team_helper.h:155
std::string GetOwnerID() const
Definition: nim_team_helper.h:115
std::string GetCustom() const
Definition: nim_team_helper.h:200
std::string GetIcon() const
Definition: nim_team_helper.h:212
void SetName(const std::string &name)
Definition: nim_team_helper.h:100
bool IsValid() const
Definition: nim_team_helper.h:134
int64_t GetUpdateTimetag() const
Definition: nim_team_helper.h:158
void SetCreateTimetag(int64_t timetag)
Definition: nim_team_helper.h:149
std::string GetServerCustom() const
Definition: nim_team_helper.h:206
void SetIntro(const std::string &intro)
Definition: nim_team_helper.h:167
void SetValid(bool valid)
Definition: nim_team_helper.h:131
int GetMemberCount() const
Definition: nim_team_helper.h:140
void SetUpdateInfoMode(NIMTeamUpdateInfoMode mode)
Definition: nim_team_helper.h:227
std::string GetAnnouncement() const
Definition: nim_team_helper.h:176
void SetMemberCount(int count)
Definition: nim_team_helper.h:137
void SetAnnouncement(const std::string &announcement)
Definition: nim_team_helper.h:173
bool IsMemberValid() const
Definition: nim_team_helper.h:164
NIMTeamUpdateInfoMode GetUpdateInfoMode() const
Definition: nim_team_helper.h:230
bool ExistValue(const std::string &nim_team_info_key) const
群组信息数据标记Key对应的数据是否有效(存在,非初始值状态)
Definition: nim_team_helper.h:256
int64_t GetMemberListTimetag() const
Definition: nim_team_helper.h:146
void SetType(nim::NIMTeamType type)
Definition: nim_team_helper.h:106
void SetCustom(const std::string &custom)
Definition: nim_team_helper.h:197
void SetProperty(const std::string &prop)
Definition: nim_team_helper.h:125
void SetMemberValid(bool valid)
Definition: nim_team_helper.h:161
void SetUpdateCustomMode(NIMTeamUpdateCustomMode mode)
Definition: nim_team_helper.h:235
NIMTeamMuteType GetMuteType() const
Definition: nim_team_helper.h:245
std::string GetProperty() const
Definition: nim_team_helper.h:128
void SetBeInviteMode(NIMTeamBeInviteMode mode)
Definition: nim_team_helper.h:215
nim::NIMTeamJoinMode GetJoinMode() const
Definition: nim_team_helper.h:182
std::string GetIntro() const
Definition: nim_team_helper.h:170
NIMTeamInviteMode GetInviteMode() const
Definition: nim_team_helper.h:224
std::string GetName() const
Definition: nim_team_helper.h:103
void SetOwnerID(const std::string &id)
Definition: nim_team_helper.h:112
void SetInviteMode(NIMTeamInviteMode mode)
Definition: nim_team_helper.h:221
int64_t GetCreateTimetag() const
Definition: nim_team_helper.h:152
int GetMemberMaxCount() const
Definition: nim_team_helper.h:123
void SetTeamID(const std::string &id)
Definition: nim_team_helper.h:94
void SetIcon(const std::string &icon)
Definition: nim_team_helper.h:209
void SetJoinMode(nim::NIMTeamJoinMode mode)
Definition: nim_team_helper.h:179
void SetMemberMaxCount(int count)
Definition: nim_team_helper.h:117
群组成员信息
Definition: nim_team_helper.h:282
std::string GetCustom() const
Definition: nim_team_helper.h:352
void SetCreateTimetag(int64_t timetag)
Definition: nim_team_helper.h:332
std::string GetAccountID() const
Definition: nim_team_helper.h:305
void SetUpdateTimetag(int64_t timetag)
Definition: nim_team_helper.h:338
nim::NIMTeamUserType GetUserType() const
Definition: nim_team_helper.h:311
void SetUserType(nim::NIMTeamUserType type)
Definition: nim_team_helper.h:308
void SetAccountID(const std::string &id)
Definition: nim_team_helper.h:302
int64_t GetCreateTimetag() const
Definition: nim_team_helper.h:335
void SetCustom(const std::string &custom)
Definition: nim_team_helper.h:350
void SetNick(const std::string &nick)
Definition: nim_team_helper.h:314
std::string GetNick() const
Definition: nim_team_helper.h:317
TeamMemberProperty(const std::string &team_id, const std::string &accid, const nim::NIMTeamUserType type)
Definition: nim_team_helper.h:285
std::string GetTeamID() const
Definition: nim_team_helper.h:299
TeamMemberProperty()
Definition: nim_team_helper.h:292
bool IsValid() const
Definition: nim_team_helper.h:329
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_team_helper.h:366
void SetBits(int64_t bit)
Definition: nim_team_helper.h:320
int64_t GetUpdateTimetag() const
Definition: nim_team_helper.h:341
int64_t GetBits() const
Definition: nim_team_helper.h:323
bool ExistValue(const std::string &nim_team_user_key) const
群成员信息信息数据标记Key对应的数据是否有效(存在,非初始值状态)
Definition: nim_team_helper.h:360
void SetTeamID(const std::string &id)
Definition: nim_team_helper.h:296
bool IsMute() const
Definition: nim_team_helper.h:347
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
获取member info json value
Definition: nim_team_helper.h:372
void SetMute(bool mute)
Definition: nim_team_helper.h:344
void SetValid(bool valid)
Definition: nim_team_helper.h:326