public class GroupChatInvitation
extends java.lang.Object
implements org.jivesoftware.smack.packet.ExtensionElement
Message message = new Message("user@chat.example.com");
message.setBody("Join me for a group chat!");
message.addExtension(new GroupChatInvitation("room@chat.example.com"););
con.sendStanza(message);
To listen for group chat invitations, use a StanzaExtensionFilter for the
x element name and jabber:x:conference namespace, as in the
following code example:
PacketFilter filter = new StanzaExtensionFilter("x", "jabber:x:conference");
// Create a stanza collector or stanza listeners using the filter...
Note: this protocol is outdated now that the Multi-User Chat (MUC) XEP is available
(XEP-45). However, most
existing clients still use this older protocol. Once MUC support becomes more
widespread, this API may be deprecated.| Modifier and Type | Class and Description |
|---|---|
static class |
GroupChatInvitation.Provider |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ELEMENT
Element name of the stanza extension.
|
static java.lang.String |
NAMESPACE
Namespace of the stanza extension.
|
static javax.xml.namespace.QName |
QNAME |
| Constructor and Description |
|---|
GroupChatInvitation(java.lang.String roomAddress)
Creates a new group chat invitation to the specified room address.
|
| Modifier and Type | Method and Description |
|---|---|
static GroupChatInvitation |
from(org.jivesoftware.smack.packet.Stanza packet)
Get the group chat invitation from the given stanza.
|
java.lang.String |
getElementName() |
java.lang.String |
getNamespace() |
java.lang.String |
getRoomAddress()
Returns the address of the group chat room.
|
org.jivesoftware.smack.util.XmlStringBuilder |
toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) |
public static final java.lang.String ELEMENT
public static final java.lang.String NAMESPACE
public static final javax.xml.namespace.QName QNAME
public GroupChatInvitation(java.lang.String roomAddress)
room@service,
where service is the name of group chat server, such as
chat.example.com.roomAddress - the address of the group chat room.public java.lang.String getRoomAddress()
room@service, where service is
the name of group chat server, such as chat.example.com.public java.lang.String getElementName()
getElementName in interface org.jivesoftware.smack.packet.NamedElementpublic java.lang.String getNamespace()
getNamespace in interface org.jivesoftware.smack.packet.XmlElementpublic org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
toXML in interface org.jivesoftware.smack.packet.Elementpublic static GroupChatInvitation from(org.jivesoftware.smack.packet.Stanza packet)
packet - TODO javadoc me please