NIM SDK API  9.0.0
Public Types | Static Public Member Functions | List of all members
nim::SuperTeam Class Reference

超大群组功能;主要包括查询群信息、查询群成员信息、加人、踢人等功能 More...

#include <nim_cpp_super_team.h>

Public Types

typedef std::function< void(const SuperTeamEvent &team_event)> SuperTeamEventCallback
 
typedef std::function< void(int team_count, const std::list< std::string > &team_id_list)> QueryAllMySuperTeamsCallback
 
typedef std::function< void(int team_count, const std::list< nim::SuperTeamInfo > &team_info_list)> QueryAllMySuperTeamsInfoCallback
 
typedef std::function< void(int count, const std::list< nim::SuperTeamMemberProperty > &all_my_member_info_list)> QueryMyAllMemberInfosCallback
 
typedef std::function< void(NIMResCode error_code, const std::string &tid, int member_count, const std::list< SuperTeamMemberProperty > &props)> QuerySuperTeamMembersCallback
 
typedef std::function< void(const SuperTeamMemberProperty &team_member_property)> QuerySuperTeamMemberCallback
 
typedef std::function< void(const std::string &tid, const SuperTeamInfo &result)> QuerySuperTeamInfoCallback
 
typedef std::function< void(NIMResCode error_code, const std::string &tid, const std::list< SuperTeamMemberProperty > &team_member_propertys)> QuerySuperTeamMembersOnlineCallback
 

Static Public Member Functions

static void RegSuperTeamEventCb (const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool InviteAsync (const std::string &tid, const std::list< std::string > &ids, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool InviteAsync2 (const std::string &tid, const std::list< std::string > &ids, const std::string &invitation_postscript, const std::string &invitation_attachment, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool KickAsync (const std::string &tid, const std::list< std::string > &ids, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool LeaveAsync (const std::string &tid, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool UpdateSuperTeamInfoAsync (const std::string &tid, const SuperTeamInfo &team_info, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool UpdateMyPropertyAsync (const SuperTeamMemberProperty &prop, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool ApplyJoinAsync (const std::string &tid, const std::string &reason, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool PassJoinApplyAsync (const std::string &tid, const std::string &applicant_id, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool RejectJoinApplyAsync (const std::string &tid, const std::string &applicant_id, const std::string &reason, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool AddManagersAsync (const std::string &tid, const std::list< std::string > &ids, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool RemoveManagersAsync (const std::string &tid, const std::list< std::string > &ids, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool TransferTeamAsync (const std::string &tid, const std::string &new_owner_id, bool is_leave, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool UpdateOtherNickAsync (const SuperTeamMemberProperty &prop, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool AcceptInvitationAsync (const std::string &tid, const std::string &invitor_id, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool RejectInvitationAsync (const std::string &tid, const std::string &invitor_id, const std::string &reason, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool MuteMemberAsync (const std::string &tid, const std::string &member_id, bool set_mute, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool QueryMuteListAsync (const std::string &tid, const QuerySuperTeamMembersCallback &cb, const std::string &json_extension="")
 
static bool MuteAsync (const std::string &tid, bool set_mute, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static void QueryAllMySuperTeamsAsync (const QueryAllMySuperTeamsCallback &cb, const std::string &json_extension="")
 
static void QueryAllMySuperTeamsInfoAsync (const QueryAllMySuperTeamsInfoCallback &cb, const std::string &json_extension="")
 
static bool QuerySuperTeamsInfoByKeywordAsync (const std::string &keyword, const QueryAllMySuperTeamsInfoCallback &cb, const std::string &json_extension="")
 
static void QueryMyAllMemberInfosAsync (const QueryMyAllMemberInfosCallback &cb, const std::string &json_extension="")
 
static bool QuerySuperTeamMembersAsync (const std::string &tid, const QuerySuperTeamMembersCallback &cb, const std::string &json_extension="")
 
static bool QuerySuperTeamMemberAsync (const std::string &tid, const std::string &id, const QuerySuperTeamMemberCallback &cb, const std::string &json_extension="")
 
static SuperTeamMemberProperty QuerySuperTeamMemberBlock (const std::string &tid, const std::string &id)
 
static bool QuerySuperTeamInfoAsync (const std::string &tid, const QuerySuperTeamInfoCallback &cb, const std::string &json_extension="")
 
static SuperTeamInfo QuerySuperTeamInfoBlock (const std::string &tid)
 
static bool QuerySuperTeamInfoOnlineAsync (const std::string &tid, const SuperTeamEventCallback &cb, const std::string &json_extension="")
 
static bool ParseSuperTeamInfo (const std::string &json_team_info, SuperTeamInfo &team_info)
 
static void UnregSuperTeamCb ()
 

Detailed Description

超大群组功能;主要包括查询群信息、查询群成员信息、加人、踢人等功能

Member Typedef Documentation

◆ QueryAllMySuperTeamsCallback

typedef std::function<void(int team_count, const std::list<std::string>& team_id_list)> nim::SuperTeam::QueryAllMySuperTeamsCallback

查询本人所有群ID回调模板

◆ QueryAllMySuperTeamsInfoCallback

typedef std::function<void(int team_count, const std::list<nim::SuperTeamInfo>& team_info_list)> nim::SuperTeam::QueryAllMySuperTeamsInfoCallback

查询本人所有群信息回调模板

◆ QueryMyAllMemberInfosCallback

typedef std::function<void(int count, const std::list<nim::SuperTeamMemberProperty>& all_my_member_info_list)> nim::SuperTeam::QueryMyAllMemberInfosCallback

查询本人所有群里我的成员信息回调模板

◆ QuerySuperTeamInfoCallback

typedef std::function<void(const std::string& tid, const SuperTeamInfo& result)> nim::SuperTeam::QuerySuperTeamInfoCallback

查询指定群信息回调模板

◆ QuerySuperTeamMemberCallback

typedef std::function<void(const SuperTeamMemberProperty& team_member_property)> nim::SuperTeam::QuerySuperTeamMemberCallback

查询指定群成员信息回调模板

◆ QuerySuperTeamMembersCallback

typedef std::function<void(NIMResCode error_code, const std::string& tid, int member_count, const std::list<SuperTeamMemberProperty>& props)> nim::SuperTeam::QuerySuperTeamMembersCallback

查询指定群组全部成员信息回调模板

◆ QuerySuperTeamMembersOnlineCallback

typedef std::function<void(NIMResCode error_code, const std::string& tid, const std::list<SuperTeamMemberProperty>& team_member_propertys)> nim::SuperTeam::QuerySuperTeamMembersOnlineCallback

查询群成员信息回调模板

◆ SuperTeamEventCallback

typedef std::function<void(const SuperTeamEvent& team_event)> nim::SuperTeam::SuperTeamEventCallback

群组事件通知回调模板

Member Function Documentation

◆ AcceptInvitationAsync()

static bool nim::SuperTeam::AcceptInvitationAsync ( const std::string &  tid,
const std::string &  invitor_id,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

接受邀请

Parameters
[in]tid群组id
[in]invitor_id邀请者id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb接受邀请的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:没有权限 803:群不存在 809:已经在群里

◆ AddManagersAsync()

static bool nim::SuperTeam::AddManagersAsync ( const std::string &  tid,
const std::list< std::string > &  ids,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

添加管理员

Parameters
[in]tid群组id
[in]ids管理员id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb添加管理员的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:没有权限 803:群不存在 815:管理员数量上限

◆ ApplyJoinAsync()

static bool nim::SuperTeam::ApplyJoinAsync ( const std::string &  tid,
const std::string &  reason,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

申请入群

Parameters
[in]tid群组id
[in]reason附言
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb申请入群的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:群验证方式为拒绝所有人申请 808:申请成功,等待验证 809:已经在群里 801:人数限制 803:群不存在 806:群数量上限

◆ InviteAsync()

static bool nim::SuperTeam::InviteAsync ( const std::string &  tid,
const std::list< std::string > &  ids,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

邀请

Parameters
[in]tid群组id
[in]ids邀请对象id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb邀请的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 404:目标不存在 801:群人数超限 802:没有权限 803:群不存在 804:用户不在群里面 813:部分成功

◆ InviteAsync2()

static bool nim::SuperTeam::InviteAsync2 ( const std::string &  tid,
const std::list< std::string > &  ids,
const std::string &  invitation_postscript,
const std::string &  invitation_attachment,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

邀请

Parameters
[in]tid群组id
[in]ids邀请对象id
[in]invitation_postscript邀请附言
[in]invitation_attachment用户可自定义的补充邀请信息
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb邀请的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 810:如果是高级群,返回810表示邀请成功并带上timetag 404:非法用户 801:群人数超限 802:没有权限 803:群不存在

◆ KickAsync()

static bool nim::SuperTeam::KickAsync ( const std::string &  tid,
const std::list< std::string > &  ids,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

踢人

Parameters
[in]tid群组id
[in]ids被踢对象id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb踢人的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 414:踢人数量超限 802:群人数超限、不能踢自己 803:群不存在 804:用户不在群里面

◆ LeaveAsync()

static bool nim::SuperTeam::LeaveAsync ( const std::string &  tid,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

离开群

Parameters
[in]tid群组id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb离开群的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 802:没有群权限、群主不能退群 803:群不存在 804:用户不在群里

◆ MuteAsync()

static bool nim::SuperTeam::MuteAsync ( const std::string &  tid,
bool  set_mute,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

群禁言/解除群禁言

Parameters
[in]tid群组id
[in]set_mute禁言/解除禁言
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb踢人的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 414:参数错误

◆ MuteMemberAsync()

static bool nim::SuperTeam::MuteMemberAsync ( const std::string &  tid,
const std::string &  member_id,
bool  set_mute,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

禁言/解除禁言

Parameters
[in]tid群组id
[in]member_id操作对象id
[in]set_mute禁言/解除禁言
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb踢人的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 404:禁言对象不存在 414:参数错误 803:群不存在 802:没有权限

◆ ParseSuperTeamInfo()

static bool nim::SuperTeam::ParseSuperTeamInfo ( const std::string &  json_team_info,
SuperTeamInfo team_info 
)
static

解析群组信息

Parameters
[in]json_team_infojson格式的群组信息
[out]team_info群组信息
Returns
bool 解析成功失败

◆ PassJoinApplyAsync()

static bool nim::SuperTeam::PassJoinApplyAsync ( const std::string &  tid,
const std::string &  applicant_id,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

同意入群申请

Parameters
[in]tid群组id
[in]applicant_id申请者id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb同意入群申请的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 809:已经在群里 801:人数限制 802:没有权限 803:群不存在

◆ QueryAllMySuperTeamsAsync()

static bool nim::SuperTeam::QueryAllMySuperTeamsAsync ( const QueryAllMySuperTeamsCallback cb,
const std::string &  json_extension = "" 
)
static

查询所有群

Parameters
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询所有群的回调函数
Returns
void 无返回值

◆ QueryAllMySuperTeamsInfoAsync()

static void nim::SuperTeam::QueryAllMySuperTeamsInfoAsync ( const QueryAllMySuperTeamsInfoCallback cb,
const std::string &  json_extension = "" 
)
static

查询所有群信息

Parameters
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询所有群信息的回调函数
Returns
void 无返回值

◆ QueryMuteListAsync()

bool nim::SuperTeam::QueryMuteListAsync ( const std::string &  tid,
const QuerySuperTeamMembersCallback cb,
const std::string &  json_extension = "" 
)
static

获取群禁言成员列表

Parameters
[in]tid群组id
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 803:群不存在 802:没有权限

◆ QueryMyAllMemberInfosAsync()

static void nim::SuperTeam::QueryMyAllMemberInfosAsync ( const QueryMyAllMemberInfosCallback cb,
const std::string &  json_extension = "" 
)
static

查询所有群里我的成员信息(使用场景:获取了所有群列表后,需要查询自己在每个群里自己的成员信息,使用成员信息里的bits字段,可以判断当某个群发来消息后,是否做消息通知)

Parameters
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询所有群里我的成员信息的回调函数
Returns
void 无返回值

◆ QuerySuperTeamInfoAsync()

static bool nim::SuperTeam::QuerySuperTeamInfoAsync ( const std::string &  tid,
const QuerySuperTeamInfoCallback cb,
const std::string &  json_extension = "" 
)
static

查询群信息

Parameters
[in]tid群组id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询群信息的回调函数
Returns
bool 检查参数如果不符合要求则返回失败

◆ QuerySuperTeamInfoBlock()

static SuperTeamInfo nim::SuperTeam::QuerySuperTeamInfoBlock ( const std::string &  tid)
static

查询群信息(同步接口,堵塞NIM内部线程,谨慎使用)

Parameters
[in]tid群组id
Returns
群信息

◆ QuerySuperTeamInfoOnlineAsync()

static bool nim::SuperTeam::QuerySuperTeamInfoOnlineAsync ( const std::string &  tid,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

获取群信息(从服务器获取)

Parameters
[in]tid群组id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb获取群信息的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 802:没有群权限 803:群不存在

◆ QuerySuperTeamMemberAsync()

static bool nim::SuperTeam::QuerySuperTeamMemberAsync ( const std::string &  tid,
const std::string &  id,
const QuerySuperTeamMemberCallback cb,
const std::string &  json_extension = "" 
)
static

查询(单个)群成员信息

Parameters
[in]tid群组id
[in]id群成员id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询群成员的回调函数
Returns
bool 检查参数如果不符合要求则返回失败

◆ QuerySuperTeamMemberBlock()

static bool nim::SuperTeam::QuerySuperTeamMemberBlock ( const std::string &  tid,
const std::string &  id 
)
static

查询(单个)群成员信息(同步接口,堵塞NIM内部线程,谨慎使用)

Parameters
[in]tid群组id
[in]id群成员id
Returns
群成员信息

◆ QuerySuperTeamMembersAsync()

static void nim::SuperTeam::QuerySuperTeamMembersAsync ( const std::string &  tid,
const QuerySuperTeamMembersCallback cb,
const std::string &  json_extension = "" 
)
static

查询群成员

Parameters
[in]tid群组id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询群成员的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 406:没有变化 802:没有权限

◆ QuerySuperTeamsInfoByKeywordAsync()

static bool nim::SuperTeam::QuerySuperTeamsInfoByKeywordAsync ( const std::string &  keyword,
const QueryAllMySuperTeamsInfoCallback cb,
const std::string &  json_extension = "" 
)
static

查询所有群信息

Parameters
[in]keyword要查询的关键字
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询所有群信息的回调函数
Returns
bool 检查参数如果不符合要求则返回失败

◆ RegSuperTeamEventCb()

static void nim::SuperTeam::RegSuperTeamEventCb ( const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

(全局回调)统一注册接收群通知回调函数(创建群,收到邀请等群通知通过此接口广播,注意:服务器推送过来的群通知和APP发起请求的回调统一处理!)

Parameters
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb群通知的回调函数
Returns
void 无返回值

◆ RejectInvitationAsync()

static bool nim::SuperTeam::RejectInvitationAsync ( const std::string &  tid,
const std::string &  invitor_id,
const std::string &  reason,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

拒绝邀请

Parameters
[in]tid群组id
[in]invitor_id邀请者id
[in]reason附言
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb拒绝邀请的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:没有权限 803:群不存在 809:已经在群里

◆ RejectJoinApplyAsync()

static bool nim::SuperTeam::RejectJoinApplyAsync ( const std::string &  tid,
const std::string &  applicant_id,
const std::string &  reason,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

拒绝入群申请

Parameters
[in]tid群组id
[in]applicant_id申请者id
[in]reason附言
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb拒绝入群申请的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功,如果用户处于申请状态则会通知申请用户被拒绝 802:没有权限 803:群不存在 809:已经在群里

◆ RemoveManagersAsync()

static bool nim::SuperTeam::RemoveManagersAsync ( const std::string &  tid,
const std::list< std::string > &  ids,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

删除管理员

Parameters
[in]tid群组id
[in]ids管理员id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb删除管理员的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:没有权限 803:群不存在

◆ TransferTeamAsync()

static bool nim::SuperTeam::TransferTeamAsync ( const std::string &  tid,
const std::string &  new_owner_id,
bool  is_leave,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

移交群主

Parameters
[in]tid群组id
[in]new_owner_id移交对象id
[in]is_leave是否同时退出群
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb移交群主的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:没有权限 803:群不存在 806:群数量上限

◆ UnregSuperTeamCb()

void nim::SuperTeam::UnregSuperTeamCb ( )
static

反注册SuperTeam提供的所有回调

Returns
void 无返回值

◆ UpdateMyPropertyAsync()

static bool nim::SuperTeam::UpdateMyPropertyAsync ( const SuperTeamMemberProperty prop,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

更新自己的群属性

Parameters
[in]prop群成员属性
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb更新自己的群属性的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 414:参数错误 802:没有权限 803:群不存在 804:不在群里

◆ UpdateOtherNickAsync()

static bool nim::SuperTeam::UpdateOtherNickAsync ( const SuperTeamMemberProperty prop,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

修改别人的群昵称

Parameters
[in]prop群成员属性
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb修改别人的群昵称的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 802:没有权限 803:群不存在 804:不在群里

◆ UpdateSuperTeamInfoAsync()

static bool nim::SuperTeam::UpdateSuperTeamInfoAsync ( const std::string &  tid,
const SuperTeamInfo team_info,
const SuperTeamEventCallback cb,
const std::string &  json_extension = "" 
)
static

更新群信息

Parameters
[in]tid群组id
[in]team_info群组信息
[in]json_extensionjson扩展参数 目前可用于配置反垃圾相关参数,格式{"anti_spam_business_id":"{\"textbid":"xxxx","picbid":"xxxx"}"}
[in]cb更新群信息的回调函数
Returns
bool 检查参数如果不符合要求则返回失败
Note
错误码 200:成功 403:无超大群功能 802:没有权限 803:群不存在 804:用户不在群里

The documentation for this class was generated from the following file: