mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
PacketExtension.from(Packet), deprecate getFrom()
add 'from(Packet)' to DataForm
This commit is contained in:
parent
f0651bae2d
commit
58e430af42
14 changed files with 158 additions and 13 deletions
|
@ -95,8 +95,24 @@ public class CarbonExtension implements PacketExtension {
|
|||
* @param msg Message object to check for carbons
|
||||
*
|
||||
* @return a Carbon if available, null otherwise.
|
||||
* @deprecated use {@link #from(Message)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static CarbonExtension getFrom(Message msg) {
|
||||
return from(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a Carbon from a message, if available.
|
||||
* <p>
|
||||
* Only {@link Message} instances can contain a Carbon extensions.
|
||||
* </p>
|
||||
*
|
||||
* @param msg Message object to check for carbons
|
||||
*
|
||||
* @return a Carbon if available, null otherwise.
|
||||
*/
|
||||
public static CarbonExtension from(Message msg) {
|
||||
CarbonExtension cc = msg.getExtension(Direction.received.name(), NAMESPACE);
|
||||
if (cc == null)
|
||||
cc = msg.getExtension(Direction.sent.name(), NAMESPACE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue