1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-30 02:02:06 +01:00

Moved from org.jivesoftware.smackx to org.jivesoftware.smackx.muc.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2334 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2004-07-06 03:07:45 +00:00 committed by gdombiak
parent 9cbf692917
commit bafef8947c
10 changed files with 1528 additions and 3091 deletions

View file

@ -1,105 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
/**
* Default implementation of the ParticipantStatusListener interface.<p>
*
* This class does not provide any behavior by default. It just avoids having
* to implement all the inteface methods if the user is only interested in implementing
* some of the methods.
*
* @author Gaston Dombiak
*/
public class DefaultParticipantStatusListener implements ParticipantStatusListener {
public void kicked(String participant) {
}
public void voiceGranted(String participant) {
}
public void voiceRevoked(String participant) {
}
public void banned(String participant) {
}
public void membershipGranted(String participant) {
}
public void membershipRevoked(String participant) {
}
public void moderatorGranted(String participant) {
}
public void moderatorRevoked(String participant) {
}
public void ownershipGranted(String participant) {
}
public void ownershipRevoked(String participant) {
}
public void adminGranted(String participant) {
}
public void adminRevoked(String participant) {
}
public void nicknameChanged(String nickname) {
}
}

View file

@ -1,102 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
/**
* Default implementation of the UserStatusListener interface.<p>
*
* This class does not provide any behavior by default. It just avoids having
* to implement all the inteface methods if the user is only interested in implementing
* some of the methods.
*
* @author Gaston Dombiak
*/
public class DefaultUserStatusListener implements UserStatusListener {
public void kicked(String actor, String reason) {
}
public void voiceGranted() {
}
public void voiceRevoked() {
}
public void banned(String actor, String reason) {
}
public void membershipGranted() {
}
public void membershipRevoked() {
}
public void moderatorGranted() {
}
public void moderatorRevoked() {
}
public void ownershipGranted() {
}
public void ownershipRevoked() {
}
public void adminGranted() {
}
public void adminRevoked() {
}
}

View file

@ -1,83 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
import org.jivesoftware.smack.XMPPConnection;
/**
* A listener that is fired anytime an invitation to join a MUC room is received.
*
* @author Gaston Dombiak
*/
public interface InvitationListener {
/**
* Called when the an invitation to join a MUC room is received.<p>
*
* If the room is password-protected, the invitee will receive a password to use to join
* the room. If the room is members-only, the the invitee may be added to the member list.
*
* @param conn the XMPPConnection that received the invitation.
* @param room the room that invitation refers to.
* @param inviter the inviter that sent the invitation. (e.g. crone1@shakespeare.lit).
* @param reason the reason why the inviter sent the invitation.
* @param password the password to use when joining the room.
*/
public abstract void invitationReceived(
XMPPConnection conn,
String room,
String inviter,
String reason,
String password);
}

View file

@ -1,70 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
/**
* A listener that is fired anytime an invitee declines or rejects an invitation.
*
* @author Gaston Dombiak
*/
public interface InvitationRejectionListener {
/**
* Called when the invitee declines the invitation.
*
* @param invitee the invitee that declined the invitation. (e.g. hecate@shakespeare.lit).
* @param reason the reason why the invitee declined the invitation.
*/
public abstract void invitationDeclined(String invitee, String reason);
}

File diff suppressed because it is too large Load diff

View file

@ -1,186 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
/**
* A listener that is fired anytime a participant's status in a room is changed, such as the
* user being kicked, banned, or granted admin permissions.
*
* @author Gaston Dombiak
*/
public interface ParticipantStatusListener {
/**
* Called when a room participant has been kicked from the room. This means that the kicked
* participant is no longer participating in the room.
*
* @param participant the participant that was kicked from the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void kicked(String participant);
/**
* Called when a moderator grants voice to a visitor. This means that the visitor
* can now participate in the moderated room sending messages to all occupants.
*
* @param participant the participant that was granted voice in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void voiceGranted(String participant);
/**
* Called when a moderator revokes voice from a participant. This means that the participant
* in the room was able to speak and now is a visitor that can't send messages to the room
* occupants.
*
* @param participant the participant that was revoked voice from the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void voiceRevoked(String participant);
/**
* Called when an administrator or owner banned a participant from the room. This means that
* banned participant will no longer be able to join the room unless the ban has been removed.
*
* @param participant the participant that was banned from the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void banned(String participant);
/**
* Called when an administrator grants a user membership to the room. This means that the user
* will be able to join the members-only room.
*
* @param participant the participant that was granted membership in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void membershipGranted(String participant);
/**
* Called when an administrator revokes a user membership to the room. This means that the
* user will not be able to join the members-only room.
*
* @param participant the participant that was revoked membership from the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void membershipRevoked(String participant);
/**
* Called when an administrator grants moderator privileges to a user. This means that the user
* will be able to kick users, grant and revoke voice, invite other users, modify room's
* subject plus all the partcipants privileges.
*
* @param participant the participant that was granted moderator privileges in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void moderatorGranted(String participant);
/**
* Called when an administrator revokes moderator privileges from a user. This means that the
* user will no longer be able to kick users, grant and revoke voice, invite other users,
* modify room's subject plus all the partcipants privileges.
*
* @param participant the participant that was revoked moderator privileges in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void moderatorRevoked(String participant);
/**
* Called when an owner grants a user ownership on the room. This means that the user
* will be able to change defining room features as well as perform all administrative
* functions.
*
* @param participant the participant that was granted ownership on the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void ownershipGranted(String participant);
/**
* Called when an owner revokes a user ownership on the room. This means that the user
* will no longer be able to change defining room features as well as perform all
* administrative functions.
*
* @param participant the participant that was revoked ownership on the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void ownershipRevoked(String participant);
/**
* Called when an owner grants administrator privileges to a user. This means that the user
* will be able to perform administrative functions such as banning users and edit moderator
* list.
*
* @param participant the participant that was granted administrator privileges
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void adminGranted(String participant);
/**
* Called when an owner revokes administrator privileges from a user. This means that the user
* will no longer be able to perform administrative functions such as banning users and edit
* moderator list.
*
* @param participant the participant that was revoked administrator privileges
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void adminRevoked(String participant);
/**
* Called when a participant changed his/her nickname in the room. The new participant's
* nickname will be informed with the next available presence.
*
* @param nickname the old nickname that the participant decided to change.
*/
public abstract void nicknameChanged(String nickname);
}

View file

@ -1,70 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
/**
* A listener that is fired anytime a MUC room changes its subject.
*
* @author Gaston Dombiak
*/
public interface SubjectUpdatedListener {
/**
* Called when a MUC room has changed its subject.
*
* @param subject the new room's subject.
* @param from the user that changed the room's subject (e.g. room@conference.jabber.org/nick).
*/
public abstract void subjectUpdated(String subject, String from);
}

View file

@ -1,159 +0,0 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx;
/**
* A listener that is fired anytime your participant's status in a room is changed, such as the
* user being kicked, banned, or granted admin permissions.
*
* @author Gaston Dombiak
*/
public interface UserStatusListener {
/**
* Called when a moderator kicked your user from the room. This means that you are no longer
* participanting in the room.
*
* @param actor the moderator that kicked your user from the room (e.g. user@host.org).
* @param reason the reason provided by the actor to kick you from the room.
*/
public abstract void kicked(String actor, String reason);
/**
* Called when a moderator grants voice to your user. This means that you were a visitor in
* the moderated room before and now you can participate in the room by sending messages to
* all occupants.
*
*/
public abstract void voiceGranted();
/**
* Called when a moderator revokes voice from your user. This means that you were a
* participant in the room able to speak and now you are a visitor that can't send
* messages to the room occupants.
*
*/
public abstract void voiceRevoked();
/**
* Called when an administrator or owner banned your user from the room. This means that you
* will no longer be able to join the room unless the ban has been removed.
*
* @param actor the administrator that banned your user (e.g. user@host.org).
* @param reason the reason provided by the administrator to banned you.
*/
public abstract void banned(String actor, String reason);
/**
* Called when an administrator grants your user membership to the room. This means that you
* will be able to join the members-only room.
*
*/
public abstract void membershipGranted();
/**
* Called when an administrator revokes your user membership to the room. This means that you
* will not be able to join the members-only room.
*
*/
public abstract void membershipRevoked();
/**
* Called when an administrator grants moderator privileges to your user. This means that you
* will be able to kick users, grant and revoke voice, invite other users, modify room's
* subject plus all the partcipants privileges.
*
*/
public abstract void moderatorGranted();
/**
* Called when an administrator revokes moderator privileges from your user. This means that
* you will no longer be able to kick users, grant and revoke voice, invite other users,
* modify room's subject plus all the partcipants privileges.
*
*/
public abstract void moderatorRevoked();
/**
* Called when an owner grants to your user ownership on the room. This means that you
* will be able to change defining room features as well as perform all administrative
* functions.
*
*/
public abstract void ownershipGranted();
/**
* Called when an owner revokes from your user ownership on the room. This means that you
* will no longer be able to change defining room features as well as perform all
* administrative functions.
*
*/
public abstract void ownershipRevoked();
/**
* Called when an owner grants administrator privileges to your user. This means that you
* will be able to perform administrative functions such as banning users and edit moderator
* list.
*
*/
public abstract void adminGranted();
/**
* Called when an owner revokes administrator privileges from your user. This means that you
* will no longer be able to perform administrative functions such as banning users and edit
* moderator list.
*
*/
public abstract void adminRevoked();
}

View file

@ -0,0 +1,184 @@
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2002-2003 Jive Software. All rights reserved.
* ====================================================================
* The Jive Software License (based on Apache Software License, Version 1.1)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by
* Jive Software (http://www.jivesoftware.com)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Smack" and "Jive Software" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please
* contact webmaster@jivesoftware.com.
*
* 5. Products derived from this software may not be called "Smack",
* nor may "Smack" appear in their name, without prior written
* permission of Jive Software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL JIVE SOFTWARE OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
package org.jivesoftware.smackx.muc;
import java.util.*;
import org.jivesoftware.smack.*;
import org.jivesoftware.smackx.*;
import junit.framework.TestCase;
/**
* Tests creating new MUC rooms.
*
* @author Gaston Dombiak
*/
public class MultiUserChatCreationTest extends TestCase {
private String host = "gatoux";
private String room = "fruta124@conference." + host;
private XMPPConnection conn1 = null;
private XMPPConnection conn2 = null;
private String user1 = null;
private String user2 = null;
/**
* Constructor for MultiUserChatCreationTest.
* @param arg0
*/
public MultiUserChatCreationTest(String arg0) {
super(arg0);
}
/**
* Tests creating a new "Reserved Room".
*/
public void testCreateReservedRoom() {
MultiUserChat muc = new MultiUserChat(conn1, room);
try {
// Create the room
muc.create("testbot1");
// Get the the room's configuration form
Form form = muc.getConfigurationForm();
assertNotNull("No room configuration form", form);
// Create a new form to submit based on the original form
Form submitForm = form.createAnswerForm();
// Add default answers to the form to submit
for (Iterator fields = form.getFields(); fields.hasNext();) {
FormField field = (FormField) fields.next();
if (!FormField.TYPE_HIDDEN.equals(field.getType())
&& field.getVariable() != null) {
// Add the field values to a List
List values = new ArrayList();
for (Iterator it = field.getValues(); it.hasNext();) {
values.add((String) it.next());
}
// Sets the new answer to form to submit
submitForm.setAnswer(field.getVariable(), values);
}
}
// Update the new room's configuration
muc.sendConfigurationForm(submitForm);
// Destroy the new room
muc.destroy("The room has almost no activity...", null);
}
catch (XMPPException e) {
fail(e.getMessage());
}
}
/**
* Tests creating a new "Instant Room".
*/
public void testCreateInstantRoom() {
MultiUserChat muc = new MultiUserChat(conn1, room);
try {
// Create the room
muc.create("testbot");
// Send an empty room configuration form which indicates that we want
// an instant room
muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
// Destroy the new room
muc.destroy("The room has almost no activity...", null);
}
catch (XMPPException e) {
fail(e.getMessage());
}
}
protected void setUp() throws Exception {
super.setUp();
try {
// Connect to the server
conn1 = new XMPPConnection(host);
conn2 = new XMPPConnection(host);
// Create the test accounts
if (!conn1.getAccountManager().supportsAccountCreation())
fail("Server does not support account creation");
conn1.getAccountManager().createAccount("gato3", "gato3");
conn2.getAccountManager().createAccount("gato4", "gato4");
// Login with the test accounts
conn1.login("gato3", "gato3");
conn2.login("gato4", "gato4");
user1 = "gato3@" + conn1.getHost();
user2 = "gato4@" + conn2.getHost();
}
catch (Exception e) {
fail(e.getMessage());
}
}
protected void tearDown() throws Exception {
super.tearDown();
// Delete the created accounts for the test
conn1.getAccountManager().deleteAccount();
conn2.getAccountManager().deleteAccount();
// Close all the connections
conn1.close();
conn2.close();
}
}

File diff suppressed because it is too large Load diff