public final class AvatarManager extends ExtensionManager
Whenever an avatar update is received by a contact, either via the presence based avatar extension (XEP-0153) or the PEP-based notification (XEP-0084), the registered listeners are triggered.
By default this manager is not enabled.
This class is thread-safe.| Modifier and Type | Method and Description |
|---|---|
void |
addAvatarChangeListener(AvatarChangeListener avatarChangeListener)
Adds an avatar listener, to listen for avatar updates.
|
byte[] |
getAvatar(Jid contact)
Gets the user avatar from the user's vCard.
|
void |
publishAvatar(byte[] imageData)
Publishes an avatar to your VCard.
|
void |
removeAvatarChangeListener(AvatarChangeListener avatarChangeListener)
Removes a previously added avatar listener.
|
isEnabled, setEnabledpublic final byte[] getAvatar(Jid contact) throws XmppException
contact - The contact.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic final void publishAvatar(byte[] imageData)
throws XmppException
imageData - The avatar image data, which must be in PNG format. null resets the avatar.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic final void addAvatarChangeListener(AvatarChangeListener avatarChangeListener)
avatarChangeListener - The avatar listener.public final void removeAvatarChangeListener(AvatarChangeListener avatarChangeListener)
avatarChangeListener - The avatar listener.Copyright © 2014–2015 XMPP.rocks. All rights reserved.