mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-13 16:41:08 +01:00
Rename 'Packet' class to 'Stanza'
Smack still uses the term 'Packet' in some places. This is just the first step towards using correct XMPP terms in Smack.
This commit is contained in:
parent
9fc26f1d83
commit
4698805a34
142 changed files with 595 additions and 572 deletions
|
|
@ -18,7 +18,7 @@ package org.jivesoftware.smackx.delay;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smackx.delay.packet.DelayInformation;
|
||||
|
||||
|
|
@ -38,24 +38,24 @@ public class DelayInformationManager {
|
|||
/**
|
||||
* Get Delayed Delivery information as defined in XEP-203
|
||||
* <p>
|
||||
* Prefer {@link #getDelayInformation(Packet)} over this method for backwards compatibility.
|
||||
* Prefer {@link #getDelayInformation(Stanza)} over this method for backwards compatibility.
|
||||
* </p>
|
||||
* @param packet
|
||||
* @return the Delayed Delivery information or <code>null</code>
|
||||
*/
|
||||
public static DelayInformation getXep203DelayInformation(Packet packet) {
|
||||
public static DelayInformation getXep203DelayInformation(Stanza packet) {
|
||||
return DelayInformation.from(packet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Delayed Delivery information as defined in XEP-91
|
||||
* <p>
|
||||
* Prefer {@link #getDelayInformation(Packet)} over this method for backwards compatibility.
|
||||
* Prefer {@link #getDelayInformation(Stanza)} over this method for backwards compatibility.
|
||||
* </p>
|
||||
* @param packet
|
||||
* @return the Delayed Delivery information or <code>null</code>
|
||||
*/
|
||||
public static DelayInformation getLegacyDelayInformation(Packet packet) {
|
||||
public static DelayInformation getLegacyDelayInformation(Stanza packet) {
|
||||
return packet.getExtension(LEGACY_DELAYED_DELIVERY_ELEMENT, LEGACY_DELAYED_DELIVERY_NAMESPACE);
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ public class DelayInformationManager {
|
|||
* @param packet
|
||||
* @return the Delayed Delivery information or <code>null</code>
|
||||
*/
|
||||
public static DelayInformation getDelayInformation(Packet packet) {
|
||||
public static DelayInformation getDelayInformation(Stanza packet) {
|
||||
DelayInformation delayInformation = getXep203DelayInformation(packet);
|
||||
if (delayInformation != null) {
|
||||
return delayInformation;
|
||||
|
|
@ -80,7 +80,7 @@ public class DelayInformationManager {
|
|||
* @param packet
|
||||
* @return the Delayed Delivery timestamp or <code>null</code>
|
||||
*/
|
||||
public static Date getDelayTimestamp(Packet packet) {
|
||||
public static Date getDelayTimestamp(Stanza packet) {
|
||||
DelayInformation delayInformation = getDelayInformation(packet);
|
||||
if (delayInformation == null) {
|
||||
return null;
|
||||
|
|
@ -94,7 +94,7 @@ public class DelayInformationManager {
|
|||
* @param packet
|
||||
* @return true if the stanza got delayed.
|
||||
*/
|
||||
public static boolean isDelayedStanza(Packet packet) {
|
||||
public static boolean isDelayedStanza(Stanza packet) {
|
||||
PacketExtension packetExtension = getDelayInformation(packet);
|
||||
return packetExtension != null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.jivesoftware.smackx.delay.filter;
|
|||
|
||||
import org.jivesoftware.smack.filter.NotFilter;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smackx.delay.DelayInformationManager;
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +37,7 @@ public class DelayedStanzaFilter implements PacketFilter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(Packet packet) {
|
||||
public boolean accept(Stanza packet) {
|
||||
return DelayInformationManager.isDelayedStanza(packet);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.jivesoftware.smackx.delay.packet;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
import org.jxmpp.util.XmppDateTime;
|
||||
|
|
@ -111,10 +111,10 @@ public class DelayInformation implements PacketExtension {
|
|||
*
|
||||
* @param packet
|
||||
* @return the DelayInformation or null
|
||||
* @deprecated use {@link #from(Packet)} instead
|
||||
* @deprecated use {@link #from(Stanza)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static DelayInformation getFrom(Packet packet) {
|
||||
public static DelayInformation getFrom(Stanza packet) {
|
||||
return from(packet);
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ public class DelayInformation implements PacketExtension {
|
|||
* @param packet
|
||||
* @return the DelayInformation or null
|
||||
*/
|
||||
public static DelayInformation from(Packet packet) {
|
||||
public static DelayInformation from(Stanza packet) {
|
||||
return packet.getExtension(ELEMENT, NAMESPACE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue