2004-07-06 05:01:36 +02:00
|
|
|
/**
|
2004-11-03 00:37:00 +01:00
|
|
|
*
|
2007-02-12 01:59:05 +01:00
|
|
|
* Copyright 2003-2007 Jive Software.
|
2004-11-03 00:37:00 +01:00
|
|
|
*
|
2014-02-17 18:57:38 +01:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
2004-11-03 00:37:00 +01:00
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
package org.jivesoftware.smackx.muc;
|
|
|
|
|
2020-04-17 22:26:28 +02:00
|
|
|
import org.jivesoftware.smack.packet.Presence;
|
|
|
|
|
|
|
|
import org.jivesoftware.smackx.muc.packet.MUCUser;
|
|
|
|
|
2015-02-14 17:15:02 +01:00
|
|
|
import org.jxmpp.jid.Jid;
|
|
|
|
|
2004-07-06 05:01:36 +02:00
|
|
|
/**
|
2020-04-17 22:26:28 +02:00
|
|
|
* 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 or the room is destroyed.
|
|
|
|
* <p>
|
|
|
|
* Note that the methods {@link #kicked(Jid, String)}, {@link #banned(Jid, String)} and
|
|
|
|
* {@link #roomDestroyed(MultiUserChat, String)} will be called before the generic {@link #removed(MUCUser, Presence)}
|
|
|
|
* callback will be invoked. The generic {@link #removed(MUCUser, Presence)} callback will be invoked every time the user
|
|
|
|
* was removed from the MUC involuntarily. It is hence the recommended callback to listen for and act upon.
|
|
|
|
* </p>
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
* @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.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
* @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.
|
2020-04-17 22:26:28 +02:00
|
|
|
* @see #removed(MUCUser, Presence)
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void kicked(Jid actor, String reason) {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* all occupants.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void voiceGranted() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* messages to the room occupants.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void voiceRevoked() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* Called when an administrator or owner banned your user from the room. This means that you
|
2004-07-06 05:01:36 +02:00
|
|
|
* will no longer be able to join the room unless the ban has been removed.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
* @param actor the administrator that banned your user (e.g. user@host.org).
|
|
|
|
* @param reason the reason provided by the administrator to banned you.
|
2020-04-17 22:26:28 +02:00
|
|
|
* @see #removed(MUCUser, Presence)
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void banned(Jid actor, String reason) {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
2020-04-17 22:26:28 +02:00
|
|
|
/**
|
|
|
|
* Called when a user is involuntarily removed from the room.
|
|
|
|
*
|
|
|
|
* @param mucUser the optional muc#user extension element
|
|
|
|
* @param presence the carrier presence
|
2020-04-18 13:09:41 +02:00
|
|
|
* @since 4.4.0
|
2020-04-17 22:26:28 +02:00
|
|
|
*/
|
|
|
|
default void removed(MUCUser mucUser, Presence presence) {
|
2020-05-13 22:01:17 +02:00
|
|
|
}
|
2020-04-17 22:26:28 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* Called when an administrator grants your user membership to the room. This means that you
|
|
|
|
* will be able to join the members-only room.
|
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void membershipGranted() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* Called when an administrator revokes your user membership to the room. This means that you
|
2004-07-06 05:01:36 +02:00
|
|
|
* will not be able to join the members-only room.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void membershipRevoked() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* subject plus all the partcipants privileges.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void moderatorGranted() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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,
|
2004-07-06 05:01:36 +02:00
|
|
|
* modify room's subject plus all the partcipants privileges.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void moderatorRevoked() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* functions.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void ownershipGranted() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* administrative functions.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void ownershipRevoked() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* list.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void adminGranted() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
* 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
|
2004-07-06 05:01:36 +02:00
|
|
|
* moderator list.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2004-07-06 05:01:36 +02:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void adminRevoked() {
|
|
|
|
}
|
2004-07-06 05:01:36 +02:00
|
|
|
|
2015-03-16 10:06:16 +01:00
|
|
|
/**
|
|
|
|
* Called when the room is destroyed.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2015-03-16 10:06:16 +01:00
|
|
|
* @param alternateMUC an alternate MultiUserChat, may be null.
|
|
|
|
* @param reason the reason why the room was closed, may be null.
|
2020-04-17 22:26:28 +02:00
|
|
|
* @see #removed(MUCUser, Presence)
|
2015-03-16 10:06:16 +01:00
|
|
|
*/
|
2020-05-13 22:01:17 +02:00
|
|
|
default void roomDestroyed(MultiUserChat alternateMUC, String reason) {
|
|
|
|
}
|
2015-03-16 10:06:16 +01:00
|
|
|
|
2004-07-06 05:01:36 +02:00
|
|
|
}
|