mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 02:39:42 +02:00
Rename PacketFilter (and implementing classes) and PacketExtension
to StanzaFilter and ExtensionElement.
This commit is contained in:
parent
2250ac20ed
commit
d4a6d8e653
233 changed files with 1175 additions and 895 deletions
|
@ -89,7 +89,7 @@ req.setTo("juliet@capulet.com/balcony");
|
|||
|
||||
// send it
|
||||
connection.sendIqWithResponseCallback(req, new PacketListener() {
|
||||
public void processPacket(Packet packet) {
|
||||
public void processPacket(Stanza packet) {
|
||||
HttpOverXmppResp resp = (HttpOverXmppResp) iq;
|
||||
// check HTTP response code
|
||||
if (resp.getStatusCode() == 200) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Group Chat Invitations
|
||||
======================
|
||||
|
||||
The group chat invitation packet extension is used to invite other users to a
|
||||
The group chat invitation extension is used to invite other users to a
|
||||
group chat room.
|
||||
|
||||
* Inviting Other Users
|
||||
|
@ -20,7 +20,7 @@ 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);
|
||||
con.sendStanza(message);
|
||||
```
|
||||
|
||||
The XML generated for the invitation portion of the code above would be:
|
||||
|
@ -32,11 +32,11 @@ The XML generated for the invitation portion of the code above would be:
|
|||
Listening for Invitations
|
||||
-------------------------
|
||||
|
||||
To listen for group chat invitations, use a PacketExtensionFilter for the `x`
|
||||
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 PacketExtensionFilter("x", "jabber:x:conference");
|
||||
StanzaFilter filter = new StanzaExtensionFilter("x", "jabber:x:conference");
|
||||
// Create a packet collector or packet listeners using the filter...
|
||||
```
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Packet Properties
|
||||
Stanza Properties
|
||||
=================
|
||||
|
||||
Smack provides an easy mechanism for attaching arbitrary properties to
|
||||
|
@ -20,7 +20,7 @@ jpe.setProperty("favoriteColor", new Color(0, 0, 255));
|
|||
// Add an int as a property._
|
||||
jpe.setProperty("favoriteNumber", 4);
|
||||
// Add the JivePropertiesExtension to the message packet_
|
||||
message.addPacketExtension(jpe);
|
||||
message.addStanzaExtension(jpe);
|
||||
chat.sendMessage(message);
|
||||
```
|
||||
|
||||
|
@ -39,8 +39,8 @@ int favoriteNumber = ((Integer)jpe.getProperty("favoriteNumber")).intValue();
|
|||
```
|
||||
|
||||
For convenience `JivePropertiesManager` contains two helper methods namely
|
||||
`addProperty(Packet packet, String name, Object value)` and
|
||||
`getProperty(Packet packet, String name)`.
|
||||
`addProperty(Stanza packet, String name, Object value)` and
|
||||
`getProperty(Stanza packet, String name)`.
|
||||
|
||||
Objects as Properties
|
||||
---------------------
|
||||
|
|
|
@ -98,7 +98,7 @@ done. The last step is to send the message as you do with any other message.
|
|||
An XHTML message is like any regular message, therefore to send the message
|
||||
you can follow the usual steps you do in order to send a message. For example,
|
||||
to send a message as part of a chat just use the message **#send(Message)** of
|
||||
_**Chat**_ or you can use the message **#send(Packet)** of
|
||||
_**Chat**_ or you can use the message **#send(Stanza)** of
|
||||
_**XMPPConnection**_.
|
||||
|
||||
**Example**
|
||||
|
@ -143,7 +143,7 @@ XHTML bodies of any received message.
|
|||
```
|
||||
// Create a listener for the chat and display any XHTML content
|
||||
PacketListener packetListener = new PacketListener() {
|
||||
public void processPacket(Packet packet) {
|
||||
public void processPacket(Stanza packet) {
|
||||
Message message = (Message) packet;
|
||||
// Obtain the XHTML bodies of the message
|
||||
List<CharSequence> bodies = XHTMLManager.getBodies(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue