public class VCardTempXUpdatePresenceExtension
extends java.lang.Object
implements org.jivesoftware.smack.packet.PacketExtension, org.jivesoftware.smack.PacketInterceptor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT_NAME
This presence extension element name.
|
static java.lang.String |
NAMESPACE
This presence extension namespace.
|
Constructor and Description |
---|
VCardTempXUpdatePresenceExtension(byte[] imageBytes)
Creates a new instance of this presence extension with the avatar image
given in parameter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getElementName()
Returns the root element name.
|
static java.lang.String |
getImageSha1(byte[] image)
Gets the String representation in hexadecimal of the SHA-1 hash of the
image given in parameter.
|
java.lang.String |
getNamespace()
Returns the root element XML namespace.
|
void |
interceptPacket(org.jivesoftware.smack.packet.Packet packet)
Intercepts sent presence packets in order to add this extension.
|
java.lang.String |
toXML()
Returns the XML representation of the PacketExtension.
|
boolean |
updateImage(byte[] imageBytes)
Updates the avatar image manged by this presence extension.
|
public static final java.lang.String ELEMENT_NAME
public static final java.lang.String NAMESPACE
public VCardTempXUpdatePresenceExtension(byte[] imageBytes)
imageBytes
- The avatar image.public boolean updateImage(byte[] imageBytes)
imageBytes
- The avatar image.public static java.lang.String getImageSha1(byte[] image)
image
- The image to get the hexadecimal representation of the SHA-1
hash.public java.lang.String getElementName()
getElementName
in interface org.jivesoftware.smack.packet.PacketExtension
public java.lang.String getNamespace()
getNamespace
in interface org.jivesoftware.smack.packet.PacketExtension
public java.lang.String toXML()
toXML
in interface org.jivesoftware.smack.packet.PacketExtension
public void interceptPacket(org.jivesoftware.smack.packet.Packet packet)
interceptPacket
in interface org.jivesoftware.smack.PacketInterceptor
packet
- The sent presence packet.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.