Added group chat invitation docs.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2137 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-10-13 15:39:11 +00:00 committed by mtucker
parent 357ec5c13f
commit 0f960f99a6
3 changed files with 66 additions and 0 deletions

View File

@ -44,6 +44,11 @@
<td><a href="time.html">Time Exchange</a></td>
<td><a href="http://www.jabber.org/jeps/jep-0090.html">JEP-90</a></td>
<td>Allows local time information to be shared between users.</td>
</tr>
<tr>
<td><a href="invitation.html">Group Chat Invitations</a></td>
<td>N/A</td>
<td>Send invitations to other users to join a group chat room.</td>
</tr>
</table>
</body>

View File

@ -0,0 +1,60 @@
<html>
<head>
<title>Group Chat Invitations</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="header">Group Chat Invitations</div><p>
The group chat invitation packet extension is used to invite other
users to a group chat room.
<ul>
<li><a href="#send">Inviting Other Users</a></li>
<li><a href="#listen">Listen for Invitations</a></li>
</ul>
<p>
<b>JEP related:</b> N/A -- this protocol is outdated now that the Multi-User Chat (MUC) JEP is available
(<a href="http://www.jabber.org/jeps/jep-0045.html">JEP-45</a>). However, most
existing clients still use this older protocol. Once MUC support becomes more
widespread, this API may be deprecated.
<hr>
<p><div class="subheader"><a name="send">Inviting Other Users</a></div><p>
To use the GroupChatInvitation packet extension
to invite another user to a group chat room, address a new message to the
user and set the room name appropriately, as in the following code example:
<pre>
Message message = new Message(<font color="#0000FF">"user@chat.example.com"</font>);
message.setBody(<font color="#0000FF">"Join me for a group chat!"</font>);
message.addExtension(new GroupChatInvitation(<font color="#0000FF">"room@chat.example.com"</font>));
con.sendPacket(message);
</pre>
The XML generated for the invitation portion of the code above would be:
<pre>
&lt;x xmlns="jabber:x:conference" jid="room@chat.example.com"/&gt;
</pre><p>
<hr>
<div class="subheader"><a name="listen">Listening for Invitations</a></div><p>
To listen for group chat invitations, use a PacketExtensionFilter for the
<tt>x</tt> element name and <tt>jabber:x:conference</tt> namespace, as in the
following code example:
<pre>
PacketFilter filter = new PacketExtensionFilter(<font color="#0000FF">"x"</font>, <font color="#0000FF">"jabber:x:conference"</font>);
<font color="#3f7f5f">// Create a packet collector or packet listeners using the filter...</font>
</pre>
</body>
</html>

View File

@ -16,6 +16,7 @@
<a href="messageevents.html">Message Events</a><br>
<a href="rosterexchange.html">Roster Item Exchange</a><br>
<a href="time.html">Time Exchange</a><br>
<a href="invitation.html">Group Chat Invitations</a><br>
</p>
</body>