1 /** 2 * $RCSfile: LeaveRoom.java,v $ 3 * $Revision: 1.1 $ 4 * $Date: 2005/02/06 20:02:22 $ 5 * 6 * Copyright 2004 Jive Software. 7 * 8 * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 package org.xmpp.muc; 22 23 import org.xmpp.packet.Presence; 24 25 /** 26 * Initial presence sent when joining an existing room or creating a new room. The JoinRoom presence 27 * indicates the posibility of the sender to speak MUC.<p> 28 * 29 * Code example: 30 * <pre> 31 * // Join an existing room or create a new one. 32 * JoinRoom joinRoom = new JoinRoom("john@jabber.org/notebook", "room@conference.jabber.org/nick"); 33 * 34 * component.sendPacket(joinRoom); 35 * </pre> 36 * 37 * @author Gaston Dombiak 38 */ 39 public class LeaveRoom extends Presence { 40 41 /** 42 * Creates a new Presence packet that could be sent to a MUC service in order to leave the room. 43 * 44 * @param from the full JID of the user that wants to leave the room. 45 * @param to the room JID. That is the room address plus the nickname of the user as a resource. 46 */ 47 public LeaveRoom(String from, String to) { 48 super(); 49 setFrom(from); 50 setTo(to); 51 setType(Type.unavailable); 52 } 53 } 54