Group message

4.1 Create a group object

Create a CGroupManager object and pass in the parameter of user configuration information.
Add group callback function pointer
Add getting group list callback function pointer

The class which the object belongs to needs to implement the IGroupManagerListener interface and the IGroupGetListListener interface.
m_pGroupManager = new XHGroupManager(this);
XHGroupManager::addGroupGetListListener(this);

4.2 The description of getting group list

The usage without AEC

/**
* Get group list
* @param pUserManager User information
*/
static void getGroupList(CUserManager* pUserManager)
{
XHGroupManager::getGroupList();
}
"applyGetGroupListFin" callback function will be called after calling this method

/**
* Get the user list of the specified group
* @param pUserManager Uer information
* @param strGroupId groip ID
*/
static void getUserList(CUserManager* pUserManager, string strGroupId)
{
XHGroupManager::getUserList(strGroupId);
}
"applyGetUserListFin" callback function will be called after calling this method

The usage with AEC

/**
* Get the group list
* @param pUserManager User information
*/
void getGroupList(CUserManager* pUserManager)
{
list<CGroupInfo> groupInfoList;
CInterfaceUrls::demoQueryImGroupList(m_pUserManager->m_ServiceParam.m_strUserId,groupInfoList);
applyGetGroupListFin(groupInfoList);
}
/**
* Get the user list of the specified group
* @param pUserManager User information
* @param strGroupId group ID
*/
void getUserList(CUserManager* pUserManager, string strGroupId)
{
CGroupMemoryInfo userList;
CInterfaceUrls::demoQueryImGroupInfo(m_pUserManager->m_ServiceParam.m_strUserId, strGroupId, userList);
applyGetUserListFin(userList);
}

4.3 XHGroupManager API Description

/*
* Add the callback function pointer after getting the group list
* @param pChatroomGetListListener Callback function pointer
*/
static void addGroupGetListListener(IGroupGetListListener* pGroupGetListListener);
/*
* Get the group list
* @param pUserManager User information
*/
static void getGroupList();
/*
* Get the list of group members
* @param pUserManager User information
* @param strGroupId group ID
*/
static void getUserList(string strGroupId);

/**
* Create a group
* @param groupName
*/
string createGroup(string groupName);

/**
* Delete the group
* @param groupID
*/
bool deleteGroup(string groupID);

/**
* Add group members
* @param groupID
* @param memberIDs
*/
void addGroupMembers(string groupID, list<string> memberIDs);

/**
* Delete group members
* @param groupID
* @param memberIDs
*/
void deleteGroupMembers(string groupID, list<string> memberIDs);

/**
* Set the push switch
* @param groupID
* @param enable
* @param callback
*/
void setPushEnable(string groupID, bool enable);

/**
*Send a message
* @param groupID
* @param atUserIDs
* @param Message
* @return the message which will be sent to
*/
CIMMessage* sendMessage(string groupID, list<string> atUserIDs, string Message);

/**
*Send an online message
* @param groupID
* @param atUserIDs
* @param Message
* @return the message which will be sent to
*/
CIMMessage* sendOnlineMessage(string groupID, list<string> atUserIDs, string Message);