mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Convert html documentation to markdown
This commit is contained in:
parent
450015bf40
commit
344148eaed
56 changed files with 3545 additions and 4217 deletions
42
documentation/extensions/invitation.md
Normal file
42
documentation/extensions/invitation.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
Group Chat Invitations
|
||||
======================
|
||||
|
||||
The group chat invitation packet extension is used to invite other users to a
|
||||
group chat room.
|
||||
|
||||
* Inviting Other Users
|
||||
* Listen for Invitations
|
||||
|
||||
**XEP related:** N/A -- this protocol is outdated now that the Multi-User Chat (MUC) XEP is available ([XEP-45](http://www.xmpp.org/extensions/xep-0045.html)). However, most existing clients still use this older protocol. Once MUC support becomes more widespread, this API may be deprecated.
|
||||
|
||||
Inviting Other Users
|
||||
--------------------
|
||||
|
||||
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:
|
||||
|
||||
```
|
||||
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.sendPacket(message);
|
||||
```
|
||||
|
||||
The XML generated for the invitation portion of the code above would be:
|
||||
|
||||
```
|
||||
<x xmlns="jabber:x:conference" jid="room@chat.example.com"/>
|
||||
```
|
||||
|
||||
Listening for Invitations
|
||||
-------------------------
|
||||
|
||||
To listen for group chat invitations, use a PacketExtensionFilter for the `x`
|
||||
element name and `jabber:x:conference` namespace, as in the following code
|
||||
example:
|
||||
|
||||
```
|
||||
PacketFilter filter = new PacketExtensionFilter("x", "jabber:x:conference");
|
||||
// Create a packet collector or packet listeners using the filter...
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue