Chatroom message

6.1 Get XHChatroomManager instance and add the chatroom event protocol function.

/**
The number of chatroom members has changed

@param chatroomID chatroom ID
@param membersNumber chatroom member number
*/
- (void)chatroom:(NSString *)chatroomID didMembersNumberUpdated:(NSInteger)membersNumber
{
}
/**
You are removed from the current chatroom

@param kickOutUserId user ID
*/
- (void)chatroomUserKicked:(NSString *)kickOutUserId
{
}
/**
Notification of the chatroom close
*/
- (void)chatroomDidColsed
{
}
/**
Receive a chatroom message

@param message message
*/
- (void)chatroomMessagesDidReceive:(NSString *)message fromID:(NSString *)fromID
{
}
/**
Receive a chatroom private message

@param message message
*/
- (void)chatroomPrivateMessagesDidReceive:(NSString *)message fromID:(NSString *)fromID
{
}
/**
Chatroom error

@param errString error information
*/
-(void)chatRoomErr:(NSString *)errString
{
}
/**
Insufficient of chat balance
*/
-(void) chatroomSendMsgNoFee
{
}

/**
You are banned in the chatroom
@param remainTimeSec remaining banned seconds
*/
-(void) chatroomSendMsgBanned:(int) remainTimeSec
{
}

6.2 XHChatroomManager API Description

/**
Create a chatroom
@param chatroomName chatroom name
@param type chatroom type
@param completion callback
*/
- (void)createChatroom:(NSString *)chatroomName type:(XHChatroomType)type completion:(void(^)(NSString *chatRoomID,NSError *error))completion;

/**
delete the chatroom
@param chatroomID chatroom ID
@param completion callback
*/
- (void)deleteChatroom:(NSString *)chatroomID completion:(void(^)(NSError *error))completion;

/**
join the chatroom
@param chatroomID chatroom ID
@param completion callback
*/
- (void)joinChatroom:(NSString *)chatroomID completion:(void(^)(NSError *error))completion;

/**
exit the chatroom
@param chatroomID chatroom ID
@param completion callback
*/
- (void)exitChatroom:(NSString *)chatroomID completion:(void(^)(NSError *error))completion;

/**
mute somebody in the chatroom
@param member the member who is being muted
@param seconds mute time
@param chatroomId chatroom ID
@param completion callback
*/
- (void)muteMember:(NSString*)member
muteSeconds:(NSInteger)seconds
fromChatroom:(NSString *)chatroomId
completion:(void(^)(NSError *error))completion;

/**
unmute somebody in the chatroom
@param member the member who is being unmuted
@param chatroomId chatroom ID
@param completion callback
*/
- (void)unMuteMember:(NSString *)member
fromChatroom:(NSString *)chatroomId
completion:(void(^)(NSError *error))completion;
/**
kick out users in the chatroom
@param member the member who is being kicked out
@param chatroomId chatroom ID
@param completion callback
*/
- (void)removeMember:(NSString *)member
fromChatroom:(NSString *)chatroomId
completion:(void(^)(NSError *error))completion;

/**
Send a message
@param message message
@param completion callback
*/
- (void)sendMessage:(NSString *)message completion:(void(^)(NSError *error))completion;

/**
Send a private message
@param message message
@param toID receiver id
@param completion callback
*/
- (void)sendMessage:(NSString *)message toID:(NSString *)toID completion:(void(^)(NSError *error))completion;