1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-14 06:51:08 +01:00

PacketExtension.from(Packet), deprecate getFrom()

add 'from(Packet)' to DataForm
This commit is contained in:
Florian Schmaus 2014-09-16 22:14:10 +02:00
parent f0651bae2d
commit 58e430af42
14 changed files with 158 additions and 13 deletions

View file

@ -105,7 +105,23 @@ public class GroupChatInvitation implements PacketExtension {
return xml;
}
/**
*
* @param packet
* @return the GroupChatInvitation or null
* @deprecated use {@link #from(Packet)} instead
*/
@Deprecated
public static GroupChatInvitation getFrom(Packet packet) {
return from(packet);
}
/**
*
* @param packet
* @return the GroupChatInvitation or null
*/
public static GroupChatInvitation from(Packet packet) {
return packet.getExtension(ELEMENT, NAMESPACE);
}

View file

@ -108,8 +108,20 @@ public class MUCInitialPresence implements PacketExtension {
*
* @param packet
* @return the MUCInitialPresence PacketExtension or {@code null}
* @deprecated use {@link #from(Packet)} instead
*/
@Deprecated
public static MUCInitialPresence getFrom(Packet packet) {
return from(packet);
}
/**
* Retrieve the MUCInitialPresence PacketExtension from packet, if any.
*
* @param packet
* @return the MUCInitialPresence PacketExtension or {@code null}
*/
public static MUCInitialPresence from(Packet packet) {
return packet.getExtension(ELEMENT, NAMESPACE);
}

View file

@ -206,8 +206,20 @@ public class MUCUser implements PacketExtension {
*
* @param packet
* @return the MUCUser PacketExtension or {@code null}
* @deprecated use {@link #from(Packet)} instead
*/
@Deprecated
public static MUCUser getFrom(Packet packet) {
return from(packet);
}
/**
* Retrieve the MUCUser PacketExtension from packet, if any.
*
* @param packet
* @return the MUCUser PacketExtension or {@code null}
*/
public static MUCUser from(Packet packet) {
return packet.getExtension(ELEMENT, NAMESPACE);
}