01: /**
02: * Copyright (C) 2004-2007 Jive Software. All rights reserved.
03: *
04: * This software is published under the terms of the GNU Public License (GPL),
05: * a copy of which is included in this distribution.
06: */package org.xmpp.muc;
07:
08: import org.xmpp.packet.Presence;
09:
10: /**
11: * Initial presence sent when joining an existing room or creating a new room. The JoinRoom presence
12: * indicates the posibility of the sender to speak MUC.<p>
13: *
14: * Code example:
15: * <pre>
16: * // Join an existing room or create a new one.
17: * JoinRoom joinRoom = new JoinRoom("john@jabber.org/notebook", "room@conference.jabber.org/nick");
18: *
19: * component.sendPacket(joinRoom);
20: * </pre>
21: *
22: * @author Gaston Dombiak
23: */
24: public class JoinRoom extends Presence {
25:
26: /**
27: * Creates a new Presence packet that could be sent to a MUC service in order to join
28: * an existing MUC room or create a new one.
29: *
30: * @param from the real full JID of the user that will join or create a MUC room.
31: * @param to a full JID where the bare JID is the MUC room address and the resource is the
32: * nickname of the user joining the room.
33: */
34: public JoinRoom(String from, String to) {
35: super ();
36: setFrom(from);
37: setTo(to);
38: addChildElement("x", "http://jabber.org/protocol/muc");
39: }
40: }
|