1 /** 2 * $RCSfile: JoinRoom.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 JoinRoom extends Presence { 40 41 /** 42 * Creates a new Presence packet that could be sent to a MUC service in order to join 43 * an existing MUC room or create a new one. 44 * 45 * @param from the real full JID of the user that will join or create a MUC room. 46 * @param to a full JID where the bare JID is the MUC room address and the resource is the 47 * nickname of the user joining the room. 48 */ 49 public JoinRoom(String from, String to) { 50 super(); 51 setFrom(from); 52 setTo(to); 53 addChildElement("x", "http://jabber.org/protocol/muc"); 54 } 55 } 56