hyphenate_SDK4.0 4.8.0
hyphenate java IM SDK
Public Member Functions | Public Attributes | List of all members
com.hyphenate.EMChatRoomChangeListener Interface Reference

Public Member Functions

void onChatRoomDestroyed (final String roomId, final String roomName)
 
default void onMemberJoined (final String roomId, final String participant)
 
default void onMemberJoined (final String roomId, final String participant, String ext)
 
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 (EMChatRoom chatRoom)
 
default void onAttributesUpdate (String chatRoomId, Map< String, String > attributeMap, String from)
 
default void onAttributesRemoved (String chatRoomId, List< String > keyList, String from)
 

Public Attributes

int BE_KICKED = 0
 
int BE_KICKED_FOR_OFFLINE = 2
 

Detailed Description

The chat room change listener.

You can add or remove a chat room change listener by using com.hyphenate.chat.EMChatRoomManager.

Add a chat room change listener:

EMChatRoomManager manager = EMClient.getInstance().chatroomManager();
manager.addChatRoomChangeListener(mChatRoomChangeListener);

Remove a chat room change listener:

EMChatRoomManager manager = EMClient.getInstance().chatroomManager();
manager.removeChatRoomListener(mChatRoomChangeListener);

Member Function Documentation

◆ onAdminAdded()

void com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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() [1/2]

default void com.hyphenate.EMChatRoomChangeListener.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.
Deprecated:
This method is deprecated. Use onMemberJoined(java.lang.String, java.lang.String, java.lang.String) instead.

◆ onMemberJoined() [2/2]

default void com.hyphenate.EMChatRoomChangeListener.onMemberJoined ( final String  roomId,
final String  participant,
String  ext 
)

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.
extThe extension information.

◆ onMuteListAdded()

void com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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:
  • BE_KICKED (0): The member is removed by the chat room owner.
  • BE_KICKED_FOR_OFFLINE(2): 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 com.hyphenate.EMChatRoomChangeListener.onSpecificationChanged ( EMChatRoom  chatRoom)

Occurs when the chat room specifications changes.

All chat room members receive this event.

Parameters
chatRoomThe chat room instance.

◆ onWhiteListAdded()

void com.hyphenate.EMChatRoomChangeListener.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 com.hyphenate.EMChatRoomChangeListener.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.

Member Data Documentation

◆ BE_KICKED

int com.hyphenate.EMChatRoomChangeListener.BE_KICKED = 0

User is kicked out by chat room owner.

◆ BE_KICKED_FOR_OFFLINE

int com.hyphenate.EMChatRoomChangeListener.BE_KICKED_FOR_OFFLINE = 2

User is kicked out by server for user offline for a while(2 minutes by default).


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