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

Public Member Functions

void onChatRoomDestroyed (final String roomId, final String roomName)
 
void onMemberJoined (final String roomId, final String participant)
 
void onMemberExited (final String roomId, final String roomName, final String participant)
 
void onRemovedFromChatRoom (final int reason, final String roomId, final String roomName, final String participant)
 
void onMuteListAdded (final String chatRoomId, final List< String > mutes, final long expireTime)
 
void onMuteListRemoved (final String chatRoomId, final List< String > mutes)
 
void onWhiteListAdded (final String chatRoomId, final List< String > whitelist)
 
void onWhiteListRemoved (final String chatRoomId, final List< String > whitelist)
 
void onAllMemberMuteStateChanged (final String chatRoomId, final boolean isMuted)
 
void onAdminAdded (final String chatRoomId, final String admin)
 
void onAdminRemoved (final String chatRoomId, final String admin)
 
void onOwnerChanged (final String chatRoomId, final String newOwner, final String oldOwner)
 
void onAnnouncementChanged (String chatRoomId, String announcement)
 
default void onSpecificationChanged (ChatRoom chatRoom)
 
default void onAttributesUpdate (String chatRoomId, Map< String, String > attributeMap, String from)
 
default void onAttributesRemoved (String chatRoomId, List< String > keyList, String from)
 

Detailed Description

The chat room change listener.

You can add or remove a chat room change listener by using io.agora.chat.ChatRoomManager.

Add a chat room change listener:

ChatRoomManager manager = ChatClient.getInstance().chatroomManager();
manager.addChatRoomChangeListener(mChatRoomChangeListener);

Remove a chat room change listener:

ChatRoomManager manager = ChatClient.getInstance().chatroomManager();
manager.removeChatRoomListener(mChatRoomChangeListener);

Member Function Documentation

◆ onAdminAdded()

void io.agora.ChatRoomChangeListener.onAdminAdded ( final String  chatRoomId,
final String  admin 
)

Occurs when a chat room member is set as an admin.

The member set as the chat room admin receives this event.

Parameters
chatRoomIdThe chat room ID.
adminThe chat room member set as an admin.

◆ onAdminRemoved()

void io.agora.ChatRoomChangeListener.onAdminRemoved ( final String  chatRoomId,
final String  admin 
)

Occurs when the chat room member(s) is/are removed from the admin list.

The admin removed from the admin list receives this event.

Parameters
chatRoomIdThe chat room ID.
adminThe member(s) removed from the admin list.

◆ onAllMemberMuteStateChanged()

void io.agora.ChatRoomChangeListener.onAllMemberMuteStateChanged ( final String  chatRoomId,
final boolean  isMuted 
)

Occurs when all members in the chat room are muted or unmuted.

All chat room members receive this event.

Parameters
chatRoomIdThe chat room ID.
isMutedWhether all chat room members are muted or unmuted.

◆ onAnnouncementChanged()

void io.agora.ChatRoomChangeListener.onAnnouncementChanged ( String  chatRoomId,
String  announcement 
)

Occurs when the chat room announcement changes.

All chat room members receive this event.

Parameters
chatRoomIdThe chat room ID.
announcementThe modified chat room announcement.

◆ onAttributesRemoved()

default void io.agora.ChatRoomChangeListener.onAttributesRemoved ( String  chatRoomId,
List< String >  keyList,
String  from 
)

The custom chat room attribute(s) is/are removed.

All chat room members receive this event.

Parameters
chatRoomIdThe chat room ID.
keyListThe list of custom chat room attributes key.
fromThe user ID of the operator.

◆ onAttributesUpdate()

default void io.agora.ChatRoomChangeListener.onAttributesUpdate ( String  chatRoomId,
Map< String, String >  attributeMap,
String  from 
)

The custom chat room attribute(s) is/are updated.

All chat room members receive this event.

Parameters
chatRoomIdThe chat room ID.
attributeMapThe map of custom chat room attributes.
fromThe user ID of the operator.

◆ onChatRoomDestroyed()

void io.agora.ChatRoomChangeListener.onChatRoomDestroyed ( final String  roomId,
final String  roomName 
)

Occurs when the chat room is destroyed.

All chat room members receive this event.

Parameters
roomIdThe chat room ID.
roomNameThe chat room name.

◆ onMemberExited()

void io.agora.ChatRoomChangeListener.onMemberExited ( final String  roomId,
final String  roomName,
final String  participant 
)

Occurs when a member exits the chat room.

All chat room members, except the member exiting the chat room, receive this event.

Parameters
roomIdThe chat room ID.
roomNameThe chat room name.
participantThe member exiting the chat room.

◆ onMemberJoined()

void io.agora.ChatRoomChangeListener.onMemberJoined ( final String  roomId,
final String  participant 
)

Occurs when a member joins the chat room.

All chat room members, except the new member, receive this event.

Parameters
roomIdThe chat room ID.
participantThe new member.

◆ onMuteListAdded()

void io.agora.ChatRoomChangeListener.onMuteListAdded ( final String  chatRoomId,
final List< String >  mutes,
final long  expireTime 
)

Occurs when the chat room member(s) is/are added to the mute list.

The muted members receive this event. The muted members cannot send message during the mute duration.

Parameters
chatRoomIdThe chat room ID.
mutesThe muted number(s).
expireTimeThe Unix timestamp when the mute expires. The unit is millisecond. Reserved parameter.

◆ onMuteListRemoved()

void io.agora.ChatRoomChangeListener.onMuteListRemoved ( final String  chatRoomId,
final List< String >  mutes 
)

Occurs when the chat room member(s) is/are removed from the mute list.

The members that are removed from the mute list receive this event.

Parameters
chatRoomIdThe chat room ID.
mutesThe member(s) removed from the mute list.

◆ onOwnerChanged()

void io.agora.ChatRoomChangeListener.onOwnerChanged ( final String  chatRoomId,
final String  newOwner,
final String  oldOwner 
)

Occurs when the chat room owner is changed.

The chat room owner receives this event.

Parameters
chatRoomIdThe chat room ID.
newOwnerThe new chat room owner.
oldOwnerThe previous chat room owner.

◆ onRemovedFromChatRoom()

void io.agora.ChatRoomChangeListener.onRemovedFromChatRoom ( final int  reason,
final String  roomId,
final String  roomName,
final String  participant 
)

Occurs when a member is removed from a chat room.

The member that is kicked out of the chat room receive this event.

Parameters
reasonThe reason why the member is removed from the chat room:
  • xxx BE_KICKED: The member is removed by the chat room owner.
  • xxx BE_KICKED_FOR_OFFLINE: The member is disconnected from the server, probably due to network interruption.
roomIdThe chat room ID.
roomNameThe chat room name.
participantThe member removed from a chat room.

◆ onSpecificationChanged()

default void io.agora.ChatRoomChangeListener.onSpecificationChanged ( ChatRoom  chatRoom)

Occurs when the chat room specifications changes.

All chat room members receive this event.

Parameters
chatRoomThe chat room instance.

◆ onWhiteListAdded()

void io.agora.ChatRoomChangeListener.onWhiteListAdded ( final String  chatRoomId,
final List< String >  whitelist 
)

Occurs when the chat room member(s) is/are added to the allow list.

The members added to the allow list receive this event.

Parameters
chatRoomIdThe chat room ID.
whitelistThe member(s) added to the allow list.

◆ onWhiteListRemoved()

void io.agora.ChatRoomChangeListener.onWhiteListRemoved ( final String  chatRoomId,
final List< String >  whitelist 
)

Occurs when the chat room member(s) is/are removed from the allow list.

The members that are removed from the allow list receive this event.

Parameters
chatRoomIdThe chat room ID.
whitelistThe member(s) removed from the allow list.

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