Chatroom message

6.1 Get XHChatroomManager instance and add chat room listener

XHChatroomManager chatroomManager = XHClient.getInstance().getChatroomManager();
chatroomManager.addListener(new IXHChatroomManagerListener() {
@Override
public void onMembersUpdated(int number) {
//The number of chatroom members has changed
}

@Override
public void onSelfKicked() {
//You are removed from the current chatroom
}

@Override
public void onSelfMuted(int seconds) {
//You are muted in the chatroom
}

@Override
public void onClosed() {
//Notification of the chatroom close
}

@Override
public void onReceivedMessage(XHIMMessage message) {
//Receive a chatroom message
}

@Override
public void onReceivePrivateMessage(XHIMMessage message) {
//Receive a private message from the chat room (only visible to yourself)
}

@Override
public void onError(String error) {
//error
}
});

6.2 XHChatroomManager API Description

/**
* Add listener
* @param chatManagerListener Receive chat room related events
*/
void addListener(IXHChatroomManagerListener chatManagerListener);

/**
* Create a chatroom
* @param chatroomName chatroom name
* @param type chatroom type
* XHChatroomTypePublic :No login verification required
* XHChatroomTypeLogin :Login verification required
* @param callback Result callback
*/
void createChatroom(String chatroomName, XHConstants.XHChatroomType type, IXHResultCallback callback);

/**
* delete a chatroom
* @param chatroomID chatroom ID
* @param callback Result callback
*/
void deleteChatroom(String chatroomID,IXHResultCallback callback);

/**
* join the chatroom
* @param chatroomID chatroom ID
* @param callback Result callback
*/
void joinChatroom(String chatroomID,IXHResultCallback callback);

/**
* Exit the chatroom
* @param chatroomID chatroom ID
* @param callback Result callback
*/
void exitChatroom(String chatroomID,IXHResultCallback callback);

/**
* mute somebody in the chatroom
* @param chatroomID chatroom ID
* @param memberID the member who is mute
* @param muteSeconds mute time
* @param callback Result callback
*/
void muteMember(String chatroomID,String memberID, int muteSeconds,IXHResultCallback callback);

/**
* unmute somebody in the chatroom
* @param chatroomID chatroom ID
* @param memberID the member who is unmute
* @param callback Result callback
*/
void unMuteMember(String chatroomID,String memberID,IXHResultCallback callback);

/**
* kick out users in the chatroom
* @param chatroomID chatroom ID
* @param memberID the member who is being kicked out
* @param callback Result callback
*/
void kickMember(String chatroomID, String memberID, IXHResultCallback callback);

/**
* send a message
* @param message message
* @param callback Result callback
* @return Return the sent message object
*/
XHIMMessage sendMessage(String message, IXHResultCallback callback);

/**
* Send a private message
* Private messages can only be received by the target user
* @param message message
* @param toID Target user ID
* @param callback Result callback
* @return Return the sent message object
*/
XHIMMessage sendPrivateMessage(String message , String toID, IXHResultCallback callback);