mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Added notifications of occupant joining and leaving the room. SMACK-38
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2437 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
81d647af56
commit
d2187b7374
4 changed files with 135 additions and 0 deletions
|
@ -31,6 +31,12 @@ package org.jivesoftware.smackx.muc;
|
|||
*/
|
||||
public class DefaultParticipantStatusListener implements ParticipantStatusListener {
|
||||
|
||||
public void joined(String participant) {
|
||||
}
|
||||
|
||||
public void left(String participant) {
|
||||
}
|
||||
|
||||
public void kicked(String participant) {
|
||||
}
|
||||
|
||||
|
|
|
@ -2014,6 +2014,12 @@ public class MultiUserChat {
|
|||
isUserStatusModification,
|
||||
from);
|
||||
}
|
||||
else {
|
||||
// A new occupant has joined the room
|
||||
if (!isUserStatusModification) {
|
||||
fireParticipantStatusListeners("joined", from);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (presence.getType() == Presence.Type.UNAVAILABLE) {
|
||||
synchronized (occupantsMap) {
|
||||
|
@ -2027,6 +2033,11 @@ public class MultiUserChat {
|
|||
presence.getFrom().equals(myRoomJID),
|
||||
mucUser,
|
||||
from);
|
||||
} else {
|
||||
// An occupant has left the room
|
||||
if (!isUserStatusModification) {
|
||||
fireParticipantStatusListeners("left", from);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,23 @@ package org.jivesoftware.smackx.muc;
|
|||
*/
|
||||
public interface ParticipantStatusListener {
|
||||
|
||||
/**
|
||||
* Called when a new room occupant has joined the room.
|
||||
*
|
||||
* @param participant the participant that has just joined the room
|
||||
* (e.g. room@conference.jabber.org/nick).
|
||||
*/
|
||||
public abstract void joined(String participant);
|
||||
|
||||
/**
|
||||
* Called when a room occupant has left the room on its own. This means that the occupant was
|
||||
* neither kicked nor banned from the room.
|
||||
*
|
||||
* @param participant the participant that has left the room on its own.
|
||||
* (e.g. room@conference.jabber.org/nick).
|
||||
*/
|
||||
public abstract void left(String participant);
|
||||
|
||||
/**
|
||||
* Called when a room participant has been kicked from the room. This means that the kicked
|
||||
* participant is no longer participating in the room.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue