public final class AvatarManager extends Manager
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(Consumer<AvatarChangeEvent> avatarChangeListener)
Adds an avatar listener, to listen for avatar updates.
|
AsyncResult<byte[]> |
getAvatar(rocks.xmpp.addr.Jid contact)
Gets the user avatar from the user's vCard.
|
AsyncResult<BufferedImage> |
getAvatarImage(rocks.xmpp.addr.Jid contact)
Gets the user avatar from the user's vCard.
|
AsyncResult<Void> |
publishAvatar(byte[] imageData)
Publishes an avatar to your VCard.
|
AsyncResult<Void> |
publishAvatarImage(BufferedImage bufferedImage)
Publishes an avatar to your VCard.
|
void |
removeAvatarChangeListener(Consumer<AvatarChangeEvent> avatarChangeListener)
Removes a previously added avatar listener.
|
isEnabled, setEnabledpublic final AsyncResult<byte[]> getAvatar(rocks.xmpp.addr.Jid contact)
contact - The contact.public final AsyncResult<BufferedImage> getAvatarImage(rocks.xmpp.addr.Jid contact)
contact - The contact. Must not be null.public final AsyncResult<Void> publishAvatar(byte[] imageData)
imageData - The avatar image data, which must be in PNG format. null resets the avatar.public final AsyncResult<Void> publishAvatarImage(BufferedImage bufferedImage) throws XmppException
bufferedImage - The avatar image, which must be in PNG format. null
resets the avatar.XmppException - If the image could not be converted to PNG.public final void addAvatarChangeListener(Consumer<AvatarChangeEvent> avatarChangeListener)
avatarChangeListener - The avatar listener.public final void removeAvatarChangeListener(Consumer<AvatarChangeEvent> avatarChangeListener)
avatarChangeListener - The avatar listener.Copyright © 2014–2016 XMPP.rocks. All rights reserved.