hyphenate_SDK3.0
3.8.6.1
hyphenate java IM SDK
|
Public Member Functions | |
EMChatRoomManager (EMClient client, EMAChatRoomManager manager) | |
void | addChatRoomChangeListener (EMChatRoomChangeListener listener) |
void | removeChatRoomChangeListener (EMChatRoomChangeListener listener) |
void | removeChatRoomListener (EMChatRoomChangeListener listener) |
void | joinChatRoom (final String roomId, final EMValueCallBack< EMChatRoom > callback) |
void | leaveChatRoom (final String roomId) |
EMPageResult< EMChatRoom > | fetchPublicChatRoomsFromServer (int pageNum, int pageSize) throws HyphenateException |
EMCursorResult< EMChatRoom > | fetchPublicChatRoomsFromServer (int pageSize, String cursor) throws HyphenateException |
void | asyncFetchPublicChatRoomsFromServer (final int pageSize, final String cursor, final EMValueCallBack< EMCursorResult< EMChatRoom >> callback) |
void | asyncFetchPublicChatRoomsFromServer (final int pageNum, final int pageSize, final EMValueCallBack< EMPageResult< EMChatRoom >> callback) |
EMChatRoom | fetchChatRoomFromServer (String roomId) throws HyphenateException |
EMChatRoom | fetchChatRoomFromServer (String roomId, boolean fetchMembers) throws HyphenateException |
void | asyncFetchChatRoomFromServer (final String roomId, final EMValueCallBack< EMChatRoom > callback) |
EMChatRoom | getChatRoom (String roomId) |
List< EMChatRoom > | getAllChatRooms () |
EMChatRoom | createChatRoom (String subject, String description, String welcomeMessage, int maxUserCount, List< String > members) throws HyphenateException |
void | asyncCreateChatRoom (final String subject, final String description, final String welcomeMessage, final int maxUserCount, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
void | destroyChatRoom (String chatRoomId) throws HyphenateException |
void | asyncDestroyChatRoom (final String chatRoomId, final EMCallBack callBack) |
EMChatRoom | changeChatRoomSubject (String chatRoomId, String newSubject) throws HyphenateException |
void | asyncChangeChatRoomSubject (final String chatRoomId, final String newSubject, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | changeChatroomDescription (String chatRoomId, String newDescription) throws HyphenateException |
void | asyncChangeChatroomDescription (final String chatRoomId, final String newDescription, final EMValueCallBack< EMChatRoom > callBack) |
EMCursorResult< String > | fetchChatRoomMembers (String chatRoomId, String cursor, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomMembers (final String chatRoomId, final String cursor, final int pageSize, final EMValueCallBack< EMCursorResult< String >> callBack) |
EMChatRoom | muteChatRoomMembers (String chatRoomId, List< String > muteMembers, long duration) throws HyphenateException |
void | asyncMuteChatRoomMembers (final String chatRoomId, final List< String > muteMembers, final long duration, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | unMuteChatRoomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncUnMuteChatRoomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | changeOwner (String chatRoomId, String newOwner) throws HyphenateException |
void | asyncChangeOwner (final String chatRoomId, final String newOwner, final EMValueCallBack< EMChatRoom > callBack) throws HyphenateException |
EMChatRoom | addChatRoomAdmin (String chatRoomId, String admin) throws HyphenateException |
void | asyncAddChatRoomAdmin (final String chatRoomId, final String admin, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | removeChatRoomAdmin (String chatRoomId, String admin) throws HyphenateException |
void | asyncRemoveChatRoomAdmin (final String chatRoomId, final String admin, final EMValueCallBack< EMChatRoom > callBack) |
Map< String, Long > | fetchChatRoomMuteList (String chatRoomId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomMuteList (final String chatRoomId, final int pageNum, final int pageSize, final EMValueCallBack< Map< String, Long >> callBack) |
EMChatRoom | removeChatRoomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncRemoveChatRoomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | blockChatroomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncBlockChatroomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
EMChatRoom | unblockChatRoomMembers (String chatRoomId, List< String > members) throws HyphenateException |
void | asyncUnBlockChatRoomMembers (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
List< String > | fetchChatRoomBlackList (String chatRoomId, int pageNum, int pageSize) throws HyphenateException |
void | asyncFetchChatRoomBlackList (final String chatRoomId, final int pageNum, final int pageSize, final EMValueCallBack< List< String >> callBack) |
void | addToChatRoomWhiteList (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
void | removeFromChatRoomWhiteList (final String chatRoomId, final List< String > members, final EMValueCallBack< EMChatRoom > callBack) |
void | checkIfInChatRoomWhiteList (final String chatRoomId, EMValueCallBack< Boolean > callBack) |
void | fetchChatRoomWhiteList (final String chatRoomId, final EMValueCallBack< List< String >> callBack) |
void | muteAllMembers (final String chatRoomId, final EMValueCallBack< EMChatRoom > callBack) |
void | unmuteAllMembers (final String chatRoomId, final EMValueCallBack< EMChatRoom > callBack) |
void | updateChatRoomAnnouncement (String chatRoomId, String announcement) throws HyphenateException |
void | asyncUpdateChatRoomAnnouncement (final String chatRoomId, final String announcement, final EMCallBack callBack) |
String | fetchChatRoomAnnouncement (String chatRoomId) throws HyphenateException |
void | asyncFetchChatRoomAnnouncement (final String chatRoomId, final EMValueCallBack< String > callBack) |
Chat room manager, responsible for chat room join, exit, list access and member rights management and so on Such as, join a chat room:
EMClient.getInstance().chatroomManager().joinChatRoom(conversationId, new EMValueCallBack<EMChatRoom>() { public void onSuccess(EMChatRoom value) { //Do something after successfully joined the chat room } public void onError(int error, String errorMsg) { //Do something after fail to join the chat room } });
EMChatRoom com.hyphenate.chat.EMChatRoomManager.addChatRoomAdmin | ( | String | chatRoomId, |
String | admin | ||
) | throws HyphenateException |
Add chat room administrator Owner‘s authority is required Asynchronously method see asyncAddChatRoomAdmin(String, String, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
admin | Admin id to set |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.addChatRoomChangeListener | ( | EMChatRoomChangeListener | listener | ) |
Register chat room change listener Chat room destruction, member entry and exit, silence, whitelisting and so on can be listened by setting EMChatRoomChangeListener
After calling this method need to call removeChatRoomListener(EMChatRoomChangeListener) at the appropriate time to remove the listener
listener | Chat room listener, see EMChatRoomChangeListener |
void com.hyphenate.chat.EMChatRoomManager.addToChatRoomWhiteList | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Add members to whitelist Owner or administrator‘s authority is required The whitelisted user is not affected when muteAllMembers(String, EMValueCallBack) is executed by owner or admins
Asynchronously method
chatRoomId | Chat room id |
members | The member list to add |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncAddChatRoomAdmin | ( | final String | chatRoomId, |
final String | admin, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Add chat room administrator Owner‘s authority is required Synchronization method see addChatRoomAdmin(String, String)
Asynchronously method
chatRoomId | Chat room id |
admin | Admin id to set |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncBlockChatroomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Add members to chat room's black list Owner or administrator‘s authority is required As member is added to blacklist, have the following behaviors:
1.As member is added to blacklist, will be removed from chat room 2.Call the method EMChatRoomChangeListener#onRemovedFromChatRoom(int, String, String, String) to notice, the first parameter is the reason, which is EMAChatRoomManagerListener#BE_KICKED 3.The members have been added to blacklist are barred from rejoining
Synchronization method see blockChatroomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | The member list to be added to blacklist |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncChangeChatroomDescription | ( | final String | chatRoomId, |
final String | newDescription, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Change chat room description Owner‘s authority is required Synchronization method see changeChatroomDescription(String, String)
Asynchronously method
chatRoomId | Chat room id |
newDescription | New description of chat room |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncChangeChatRoomSubject | ( | final String | chatRoomId, |
final String | newSubject, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Change chat room subject Owner‘s authority is required Synchronization method see changeChatRoomSubject(String, String)
Asynchronously method
chatRoomId | Chat room id |
newSubject | New name of chat room |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncChangeOwner | ( | final String | chatRoomId, |
final String | newOwner, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) | throws HyphenateException |
Transfer chat room ownership to others Owner‘s authority is required Synchronization method see changeOwner(String, String)
Asynchronously method
chatRoomId | Chat room id |
newOwner | New owner id |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncCreateChatRoom | ( | final String | subject, |
final String | description, | ||
final String | welcomeMessage, | ||
final int | maxUserCount, | ||
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Create chat room Synchronization method see createChatRoom(String, String, String, int, List)
Asynchronously method
subject | Name of chat room |
description | Description of chat room |
welcomeMessage | Welcome message inviting members to join the chat room |
maxUserCount | Maximum number of members allowed to join |
members | Members inviting to join |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncDestroyChatRoom | ( | final String | chatRoomId, |
final EMCallBack | callBack | ||
) |
Destroy chat room Owner‘s authority is required Synchronization method see destroyChatRoom(String)
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomAnnouncement | ( | final String | chatRoomId, |
final EMValueCallBack< String > | callBack | ||
) |
Get the chat room announcement from server
chatRoomId | Chat room id |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), return the chat room announcement; failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomBlackList | ( | final String | chatRoomId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< List< String >> | callBack | ||
) |
Fetch chat room black list members in pages Owner or administrator‘s authority is required Synchronization method see fetchChatRoomBlackList(String, int, int)
Asynchronously method
chatRoomId | Chat room id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), return the blacklist in chat room; failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomFromServer | ( | final String | roomId, |
final EMValueCallBack< EMChatRoom > | callback | ||
) |
Fetch the chat room from server by room id, default not to fetch members Synchronization method see fetchChatRoomFromServer(String)
Asynchronously method
roomId | Chat room id |
callback | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomMembers | ( | final String | chatRoomId, |
final String | cursor, | ||
final int | pageSize, | ||
final EMValueCallBack< EMCursorResult< String >> | callBack | ||
) |
Fetch chat room member list When EMCursorResult.getCursor() is an empty string ("") in the result, there is no more data
Asynchronously method
chatRoomId | Chat room id |
cursor | The cursor position to fetch data |
pageSize | The count fetched a time |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchChatRoomMuteList | ( | final String | chatRoomId, |
final int | pageNum, | ||
final int | pageSize, | ||
final EMValueCallBack< Map< String, Long >> | callBack | ||
) |
Fetch mute list from server, which contains mute members and mute time Owner or administrator‘s authority is required Synchronization method see fetchChatRoomMuteList(String, int, int)
Asynchronously method
chatRoomId | Chat room id |
pageNum | The count fetched a time |
pageSize | The cursor position to fetch data |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageNum, |
final int | pageSize, | ||
final EMValueCallBack< EMPageResult< EMChatRoom >> | callback | ||
) |
Fetch the chat rooms in page
Asynchronously method
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
callback | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncFetchPublicChatRoomsFromServer | ( | final int | pageSize, |
final String | cursor, | ||
final EMValueCallBack< EMCursorResult< EMChatRoom >> | callback | ||
) |
Fetch the chat rooms in page When EMCursorResult.getCursor() is an empty string ("") in the result, there is no more data
Asynchronously method
pageSize | The count fetched a time |
cursor | The cursor position to fetch data |
callback | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncMuteChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | muteMembers, | ||
final long | duration, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Stop members post message for some time Owner or administrator‘s authority is required Synchronization method see muteChatRoomMembers(String, List, long)
Asynchronously method
chatRoomId | Chat room id |
muteMembers | Mute members list |
duration | Mute duration, in milli-seconds |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncRemoveChatRoomAdmin | ( | final String | chatRoomId, |
final String | admin, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Remove administrator's authority in chat room Owner‘s authority is required Synchronization method see removeChatRoomAdmin(String, String)
Asynchronously method
chatRoomId | Chat room id |
admin | Admin id to remove |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncRemoveChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Remove chat room members Owner or administrator‘s authority is required Synchronization method see removeChatRoomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | The members list to be removed |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncUnBlockChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Remove members from chat room's black list Owner or administrator‘s authority is required Synchronization method see unblockChatRoomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | The members list will be removed from blacklist |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncUnMuteChatRoomMembers | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Release mute Owner or administrator‘s authority is required Synchronization method see unMuteChatRoomMembers(String, List)
Asynchronously method
chatRoomId | Chat room id |
members | Release mute members list |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
void com.hyphenate.chat.EMChatRoomManager.asyncUpdateChatRoomAnnouncement | ( | final String | chatRoomId, |
final String | announcement, | ||
final EMCallBack | callBack | ||
) |
Update chat room announcement Owner or administrator‘s authority is required Synchronization method see updateChatRoomAnnouncement(String, String)
Asynchronously method
chatRoomId | Chat room id |
announcement | Announcement content |
callBack | Result callback, success call EMCallBack#onSuccess(), failure call EMCallBack#onError(int, String) |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.blockChatroomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
Add members to chat room's black list Owner or administrator‘s authority is required As member is added to blacklist, have the following behaviors:
1.As member is added to blacklist, will be removed from chat room 2.Call the method EMChatRoomChangeListener#onRemovedFromChatRoom(int, String, String, String) to notice, the first parameter is the reason, which is EMAChatRoomManagerListener#BE_KICKED 3.The members have been added to blacklist are barred from rejoining
Asynchronously method see asyncBlockChatroomMembers(String, List, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | The member list to be added to blacklist |
HyphenateException | Error info, see com.hyphenate.EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.changeChatroomDescription | ( | String | chatRoomId, |
String | newDescription | ||
) | throws HyphenateException |
change chat room description Owner‘s authority is required Asynchronously method see asyncChangeChatroomDescription(String, String, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
newDescription | New description of chat room |
HyphenateException | Error info, see com.hyphenate.EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.changeChatRoomSubject | ( | String | chatRoomId, |
String | newSubject | ||
) | throws HyphenateException |
Change chat room subject Owner‘s authority is required Asynchronously method see asyncChangeChatRoomSubject(String, String, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
newSubject | New name of chat room |
HyphenateException | Error info, see com.hyphenate.EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.changeOwner | ( | String | chatRoomId, |
String | newOwner | ||
) | throws HyphenateException |
Transfer chat room ownership to others Owner‘s authority is required Asynchronously method see asyncChangeOwner(String, String, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
newOwner | New owner id |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.checkIfInChatRoomWhiteList | ( | final String | chatRoomId, |
EMValueCallBack< Boolean > | callBack | ||
) |
Check if in whitelist
Asynchronously method
chatRoomId | chat room id |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), return the result if in whitelist failure call EMValueCallBack#onError(int, String) |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.createChatRoom | ( | String | subject, |
String | description, | ||
String | welcomeMessage, | ||
int | maxUserCount, | ||
List< String > | members | ||
) | throws HyphenateException |
Create chat room
Synchronization method will block the current thread
subject | Name of chat room |
description | Description of chat room |
welcomeMessage | Welcome message inviting members to join the chat room |
maxUserCount | Maximum number of members allowed to join |
members | Members inviting to join |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.destroyChatRoom | ( | String | chatRoomId | ) | throws HyphenateException |
Destroy chat room Owner‘s authority is required Asynchronously method see asyncDestroyChatRoom(String, EMCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
HyphenateException | Error info, see com.hyphenate.EMError |
String com.hyphenate.chat.EMChatRoomManager.fetchChatRoomAnnouncement | ( | String | chatRoomId | ) | throws HyphenateException |
Get the chat room announcement from server
chatRoomId | Chat room id |
HyphenateException | Error info, see com.hyphenate.EMError |
List<String> com.hyphenate.chat.EMChatRoomManager.fetchChatRoomBlackList | ( | String | chatRoomId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
Fetch chat room black list members in pages Owner or administrator‘s authority is required Asynchronously method see asyncFetchChatRoomBlackList(String, int, int, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
HyphenateException | Error info, see com.hyphenate.EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.fetchChatRoomFromServer | ( | String | roomId | ) | throws HyphenateException |
Fetch the chat room from server by room id, default not to fetch members Asynchronous method see asyncFetchChatRoomFromServer(String, EMValueCallBack)
Synchronization method will block the current thread
roomId | Chat room id |
HyphenateException | Error code, see com.hyphenate.EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.fetchChatRoomFromServer | ( | String | roomId, |
boolean | fetchMembers | ||
) | throws HyphenateException |
Fetch the chat room from server by room id. If fetchMembers is true, default maximum of fetched member count is 200, to continue fetch members, call EMChatRoomManager#fetchChatRoomMembers(String, String, int)
Synchronization method will block the current thread
roomId | chat room id |
fetchMembers | Whether you need to get chat room members |
HyphenateException | Error code, see com.hyphenate.EMError |
EMCursorResult<String> com.hyphenate.chat.EMChatRoomManager.fetchChatRoomMembers | ( | String | chatRoomId, |
String | cursor, | ||
int | pageSize | ||
) | throws HyphenateException |
Fetch chat room member list When EMCursorResult.getCursor() is an empty string ("") in the result, there is no more data As the synchronization method, can use asynchronous method asyncFetchChatRoomMembers(String, String, int, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
cursor | The cursor position to fetch data |
pageSize | The count fetched a time |
HyphenateException | Error info, see com.hyphenate.EMError |
Map<String, Long> com.hyphenate.chat.EMChatRoomManager.fetchChatRoomMuteList | ( | String | chatRoomId, |
int | pageNum, | ||
int | pageSize | ||
) | throws HyphenateException |
Fetch mute list from server, which contains mute members and mute time Owner or administrator‘s authority is required Asynchronously method see asyncFetchChatRoomMuteList(String, int, int, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
pageNum | The count fetched a time |
pageSize | The cursor position to fetch data |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.fetchChatRoomWhiteList | ( | final String | chatRoomId, |
final EMValueCallBack< List< String >> | callBack | ||
) |
Fetch whitelist from server Owner or administrator‘s authority is required
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
EMPageResult<EMChatRoom> com.hyphenate.chat.EMChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageNum, |
int | pageSize | ||
) | throws HyphenateException |
Fetch the chat room data in page As the synchronization method, can use asynchronous method asyncFetchPublicChatRoomsFromServer(int, int, EMValueCallBack)
Synchronization method will block the current thread
pageNum | Page number, start from 1 |
pageSize | Size to be fetched per page |
HyphenateException | Error code see com.hyphenate.EMError |
EMCursorResult<EMChatRoom> com.hyphenate.chat.EMChatRoomManager.fetchPublicChatRoomsFromServer | ( | int | pageSize, |
String | cursor | ||
) | throws HyphenateException |
Fetch the chat rooms in page When EMCursorResult.getCursor() is an empty string ("") in the result, there is no more data As the synchronization method, can use asynchronous method asyncFetchPublicChatRoomsFromServer(int, String, EMValueCallBack)
Synchronization method will block the current thread
pageSize | The count fetched a time |
cursor | The cursor position to fetch data |
HyphenateException | Error code, see com.hyphenate.EMError |
List<EMChatRoom> com.hyphenate.chat.EMChatRoomManager.getAllChatRooms | ( | ) |
Get all chat rooms in the cache in EMChatRoomManager Note: The method needs to call the following methods: (1) fetchPublicChatRoomsFromServer(int, int) and it's asynchronous method of asyncFetchPublicChatRoomsFromServer(int, int, EMValueCallBack) (2) fetchPublicChatRoomsFromServer(int, String) and it's asynchronous method of asyncFetchPublicChatRoomsFromServer(int, String, EMValueCallBack)
EMChatRoom com.hyphenate.chat.EMChatRoomManager.getChatRoom | ( | String | roomId | ) |
Get the chat room in the cache
roomId | Chat room id |
void com.hyphenate.chat.EMChatRoomManager.joinChatRoom | ( | final String | roomId, |
final EMValueCallBack< EMChatRoom > | callback | ||
) |
Join the chat room Leave chat room call leaveChatRoom(String)
Asynchronously method
roomId | Chat room id to join |
callback | Callback for success or fail. If join chat room success calls EMValueCallBack#onSuccess(Object), return the EMChatRoom instance; Failed to join chat room calls EMValueCallBack#onError(int, String), where the first parameter is the error code, the second is the error message |
void com.hyphenate.chat.EMChatRoomManager.leaveChatRoom | ( | final String | roomId | ) |
Leave the chat room After join chat room joinChatRoom(String, EMValueCallBack), you need to call this method if want to leave chat room
Asynchronously method
roomId | Chat room id to leave |
void com.hyphenate.chat.EMChatRoomManager.muteAllMembers | ( | final String | chatRoomId, |
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Mute all members Owner or administrator‘s authority is required Chat room owners, administrators and whitelisted users will not be affected
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.muteChatRoomMembers | ( | String | chatRoomId, |
List< String > | muteMembers, | ||
long | duration | ||
) | throws HyphenateException |
Stop members post messages for some time Owner or administrator‘s authority is required Asynchronously method see asyncMuteChatRoomMembers(String, List, long, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
muteMembers | Mute member list |
duration | Mute duration, in milli-seconds |
HyphenateException | Error info, see com.hyphenate.EMError |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.removeChatRoomAdmin | ( | String | chatRoomId, |
String | admin | ||
) | throws HyphenateException |
Remove administrator's authority in chat room Owner‘s authority is required Asynchronously method see asyncRemoveChatRoomAdmin(String, String, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
admin | Admin id to remove |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.removeChatRoomChangeListener | ( | EMChatRoomChangeListener | listener | ) |
Remove chat room change listener After calling addChatRoomChangeListener(EMChatRoomChangeListener) can call this method to remove listener, now it is recommended to use removeChatRoomListener(EMChatRoomChangeListener) to remove
listener | The chat room listener to be removed |
void com.hyphenate.chat.EMChatRoomManager.removeChatRoomListener | ( | EMChatRoomChangeListener | listener | ) |
Remove chat room change listener After calling addChatRoomChangeListener(EMChatRoomChangeListener) need to call this method to remove listener
listener | The chat room listener to be removed |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.removeChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
Remove chat room members Owner or administrator‘s authority is required Asynchronously method see asyncRemoveChatRoomMembers(String, List, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | The members list to be removed |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.removeFromChatRoomWhiteList | ( | final String | chatRoomId, |
final List< String > | members, | ||
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Remove members from whitelist Owner or administrator‘s authority is required When members are removed from whitelist, they are affected by muteAllMembers(String, EMValueCallBack)
Asynchronously method
chatRoomId | Chat room id |
members | The member list to remove from whitelist |
callBack |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.unblockChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
Remove members from chat room's black list Owner or administrator‘s authority is required Asynchronously method see asyncBlockChatroomMembers(String, List, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | The members list will be removed from blacklist |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.unmuteAllMembers | ( | final String | chatRoomId, |
final EMValueCallBack< EMChatRoom > | callBack | ||
) |
Release the mute status of all members Owner or administrator‘s authority is required
Asynchronously method
chatRoomId | Chat room id |
callBack | Result callback, success call EMValueCallBack#onSuccess(Object), failure call EMValueCallBack#onError(int, String) |
EMChatRoom com.hyphenate.chat.EMChatRoomManager.unMuteChatRoomMembers | ( | String | chatRoomId, |
List< String > | members | ||
) | throws HyphenateException |
Release mute Owner or administrator‘s authority is required Asynchronously method see asyncUnMuteChatRoomMembers(String, List, EMValueCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
members | Release mute members list |
HyphenateException | Error info, see com.hyphenate.EMError |
void com.hyphenate.chat.EMChatRoomManager.updateChatRoomAnnouncement | ( | String | chatRoomId, |
String | announcement | ||
) | throws HyphenateException |
Update chat room announcement Owner or administrator‘s authority is required Asynchronously method see asyncUpdateChatRoomAnnouncement(String, String, EMCallBack)
Synchronization method will block the current thread
chatRoomId | Chat room id |
announcement | Announcement content |
HyphenateException | Error info, see com.hyphenate.EMError |