001/** 002 * 003 * Copyright 2003-2007 Jive Software. 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018package org.jivesoftware.smackx.muc; 019 020import org.jxmpp.jid.Jid; 021 022/** 023 * A listener that is fired anytime your participant's status in a room is changed, such as the 024 * user being kicked, banned, or granted admin permissions or the room is destroyed. 025 * 026 * @author Gaston Dombiak 027 */ 028public interface UserStatusListener { 029 030 /** 031 * Called when a moderator kicked your user from the room. This means that you are no longer 032 * participanting in the room. 033 * 034 * @param actor the moderator that kicked your user from the room (e.g. user@host.org). 035 * @param reason the reason provided by the actor to kick you from the room. 036 */ 037 public abstract void kicked(Jid actor, String reason); 038 039 /** 040 * Called when a moderator grants voice to your user. This means that you were a visitor in 041 * the moderated room before and now you can participate in the room by sending messages to 042 * all occupants. 043 * 044 */ 045 public abstract void voiceGranted(); 046 047 /** 048 * Called when a moderator revokes voice from your user. This means that you were a 049 * participant in the room able to speak and now you are a visitor that can't send 050 * messages to the room occupants. 051 * 052 */ 053 public abstract void voiceRevoked(); 054 055 /** 056 * Called when an administrator or owner banned your user from the room. This means that you 057 * will no longer be able to join the room unless the ban has been removed. 058 * 059 * @param actor the administrator that banned your user (e.g. user@host.org). 060 * @param reason the reason provided by the administrator to banned you. 061 */ 062 public abstract void banned(Jid actor, String reason); 063 064 /** 065 * Called when an administrator grants your user membership to the room. This means that you 066 * will be able to join the members-only room. 067 * 068 */ 069 public abstract void membershipGranted(); 070 071 /** 072 * Called when an administrator revokes your user membership to the room. This means that you 073 * will not be able to join the members-only room. 074 * 075 */ 076 public abstract void membershipRevoked(); 077 078 /** 079 * Called when an administrator grants moderator privileges to your user. This means that you 080 * will be able to kick users, grant and revoke voice, invite other users, modify room's 081 * subject plus all the partcipants privileges. 082 * 083 */ 084 public abstract void moderatorGranted(); 085 086 /** 087 * Called when an administrator revokes moderator privileges from your user. This means that 088 * you will no longer be able to kick users, grant and revoke voice, invite other users, 089 * modify room's subject plus all the partcipants privileges. 090 * 091 */ 092 public abstract void moderatorRevoked(); 093 094 /** 095 * Called when an owner grants to your user ownership on the room. This means that you 096 * will be able to change defining room features as well as perform all administrative 097 * functions. 098 * 099 */ 100 public abstract void ownershipGranted(); 101 102 /** 103 * Called when an owner revokes from your user ownership on the room. This means that you 104 * will no longer be able to change defining room features as well as perform all 105 * administrative functions. 106 * 107 */ 108 public abstract void ownershipRevoked(); 109 110 /** 111 * Called when an owner grants administrator privileges to your user. This means that you 112 * will be able to perform administrative functions such as banning users and edit moderator 113 * list. 114 * 115 */ 116 public abstract void adminGranted(); 117 118 /** 119 * Called when an owner revokes administrator privileges from your user. This means that you 120 * will no longer be able to perform administrative functions such as banning users and edit 121 * moderator list. 122 * 123 */ 124 public abstract void adminRevoked(); 125 126 /** 127 * Called when the room is destroyed. 128 * 129 * @param alternateMUC an alternate MultiUserChat, may be null. 130 * @param reason the reason why the room was closed, may be null. 131 */ 132 public abstract void roomDestroyed(MultiUserChat alternateMUC, String reason); 133 134}