1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 04:22:05 +01:00

[muc] Add generic callback invoked if a participant is removed

Fixes SMACK-883.
This commit is contained in:
Florian Schmaus 2020-05-13 22:06:15 +02:00
parent ab2d3a2b79
commit 50cb7735d1
2 changed files with 15 additions and 0 deletions

View file

@ -271,6 +271,10 @@ public class MultiUserChat {
for (UserStatusListener listener : userStatusListeners) { for (UserStatusListener listener : userStatusListeners) {
listener.removed(mucUser, presence); listener.removed(mucUser, presence);
} }
} else {
for (ParticipantStatusListener listener : participantStatusListeners) {
listener.parted(from);
}
} }
break; break;
default: default:

View file

@ -50,6 +50,17 @@ public interface ParticipantStatusListener {
default void left(EntityFullJid participant) { default void left(EntityFullJid participant) {
} }
/**
* Called when a participant is parted for whatever reason. This callback is always invoked if a participant
* parted the room, either voluntarily or involuntarily. Prior this callback, a callback with a more specific
* reason for the removal, like {@link #left(EntityFullJid)} may be invoked.
*
* @param participant the participant that was removed from the room.
* @since 4.4
*/
default void parted(EntityFullJid participant) {
}
/** /**
* Called when a room participant has been kicked from the room. This means that the kicked * Called when a room participant has been kicked from the room. This means that the kicked
* participant is no longer participating in the room. * participant is no longer participating in the room.