Chat SDK for Android v1.2.1
agora java chat SDK
Classes | Public Member Functions | List of all members
io.agora.chat.ChatRoom Class Reference

Inherits io.agora.chat.EMBase< T >.

Classes

enum  ChatRoomPermissionType
 

Public Member Functions

String getId ()
 
String getName ()
 
String getDescription ()
 
String getOwner ()
 
List< String > getAdminList ()
 
int getMemberCount ()
 
int getMaxUsers ()
 
List< String > getMemberList ()
 
List< String > getBlackList ()
 
List< String > getBlacklist ()
 
Map< String, Long > getMuteList ()
 
List< String > getWhiteList ()
 
List< String > getWhitelist ()
 
boolean isAllMemberMuted ()
 
String getAnnouncement ()
 
ChatRoomPermissionType getChatRoomPermissionType ()
 

Detailed Description

Chat room types.

Member Function Documentation

◆ getAdminList()

List< String > io.agora.chat.ChatRoom.getAdminList ( )

Gets the chat room admin list. For how to get chat room, see ChatRoomManager#fetchChatRoomFromServer(String).

Returns
The chat room admin ID list. If this method returns an empty list, the SDK fails to get the admin list of the chat room.

◆ getAnnouncement()

String io.agora.chat.ChatRoom.getAnnouncement ( )

Gets the chat room announcement. To get the chat room announcement, you can call ChatRoomManager#fetchChatRoomAnnouncement(String) or its asynchronous method ChatRoomManager#asyncFetchChatRoomAnnouncement(String, ValueCallBack).

Returns
The chat room announcement. If this method returns an empty string, the SDK fails to get the chat room announcement.

◆ getBlackList()

List< String > io.agora.chat.ChatRoom.getBlackList ( )

Returns the chat room blocklist. To get the blocklist, you can call ChatRoomManager#fetchChatRoomBlackList(String, int, int). You can call this method as the chat room owner or admin or call its asynchronous method ChatRoomManager#asyncFetchChatRoomBlackList(String, int, int, ValueCallBack).

Returns
The blocklist. If this method returns an empty list, the SDK fails to get the blocklist.
Deprecated:
Deprecated. Please use ChatRoom#getBlacklist() instead.

◆ getBlacklist()

List< String > io.agora.chat.ChatRoom.getBlacklist ( )

Returns the chat room blocklist. To get the blocklist, you can call ChatRoomManager#fetchChatRoomBlackList(String, int, int). You can call this method as the chat room owner or admin or call its asynchronous method. ChatRoomManager#asyncFetchChatRoomBlackList(String, int, int, ValueCallBack).

Returns
The chat room blocklist. If this method returns an empty list, the SDK fails to get the blocklist.

◆ getChatRoomPermissionType()

ChatRoomPermissionType io.agora.chat.ChatRoom.getChatRoomPermissionType ( )

Gets the current user's role in the chat room.

Returns
The current user's role in the chat room, see ChatRoomPermissionType.

◆ getDescription()

String io.agora.chat.ChatRoom.getDescription ( )

Gets the chat room description.

Returns
The chat room description.

◆ getId()

String io.agora.chat.ChatRoom.getId ( )

Gets the chat room ID.

Returns
The chat room ID.

◆ getMaxUsers()

int io.agora.chat.ChatRoom.getMaxUsers ( )

Gets the maximum number of members in the chat room which is determined during chat room creation. This method can return a correct value only after you call ChatRoomManager::fetchChatRoomFromServer(String) to get chat room details.

Returns
The maximum number of members in a chat room. Returns 0 if the SDK fails to get the maximum number.

◆ getMemberCount()

int io.agora.chat.ChatRoom.getMemberCount ( )

Returns the number of online members.

Returns
The number of online members.

◆ getMemberList()

List< String > io.agora.chat.ChatRoom.getMemberList ( )

Returns the member list. You can get the member list in the following ways:

Returns
The member ID list. If this method returns an empty list, the SDK fails to get the member list.

◆ getMuteList()

Map< String, Long > io.agora.chat.ChatRoom.getMuteList ( )

Returns the mute list of the chat room. To get the mute list, you can call ChatRoomManager#fetchChatRoomMuteList(String, int, int). You can call this method as the chat room owner or admin or call its asynchronous method ChatRoomManager#asyncFetchChatRoomMuteList(String, int, int, ValueCallBack).

Returns
The mute list, where Map.entry.key is the ID of the muted member and Map.entry.value is the mute duration in milliseconds. If this method returns an empty map, the SDK fails to get the mute list.

◆ getName()

String io.agora.chat.ChatRoom.getName ( )

Gets the chat room name.

Returns
The chat room name.

◆ getOwner()

String io.agora.chat.ChatRoom.getOwner ( )

Gets the chat room owner. For how to get chat room details, see ChatRoomManager#fetchChatRoomFromServer(String).

Returns
The chat room owner ID. If this method returns an empty string, the SDK fails to get chat room details.

◆ getWhiteList()

List< String > io.agora.chat.ChatRoom.getWhiteList ( )

Returns the chat room allowlist. To get the allowlist, you can call ChatRoomManager#fetchChatRoomWhiteList(String, ValueCallBack). You can call this method as the chat room owner or admin.

Returns
The allowlist. If this method returns an empty list, the SDK fails to get the allowlist.
Deprecated:
Deprecated. Please use ChatRoom#getWhitelist() instead.

◆ getWhitelist()

List< String > io.agora.chat.ChatRoom.getWhitelist ( )

Returns the chat room allowlist.

To get the allowlist, you can call ChatRoomManager#fetchChatRoomWhiteList(String, ValueCallBack). You can call this method as the chat room owner or admin.

Returns
The allowlist. If this method returns an empty list, the SDK fails to get the allowlist.

◆ isAllMemberMuted()

boolean io.agora.chat.ChatRoom.isAllMemberMuted ( )

Checks whether all members are muted. This method has use limitations and should be used with caution. Pay attention to the following when using this method:

  • Upon your receipt of the callback of one-click mute or unmute after you join the chat room, the status will be updated and the staus obtained using this method is correct.
  • After you exit from the chat room before reentering it, the status obtained using this method is not trustworthy.
    Returns
    Whether all members are muted.
  • true: All members are muted.
  • false: Not all members are muted.

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