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.
features, xmppSession| Modifier and Type | Method and Description |
|---|---|
void |
addAvatarChangeListener(AvatarChangeListener avatarChangeListener)
Adds an avatar listener, to listen for avatar updates.
|
byte[] |
getAvatar(rocks.xmpp.core.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.
|
setEnabledpublic byte[] getAvatar(rocks.xmpp.core.Jid contact)
throws rocks.xmpp.core.XmppException
contact - The contact.rocks.xmpp.core.stanza.model.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.rocks.xmpp.core.XmppExceptionpublic void publishAvatar(byte[] imageData)
throws rocks.xmpp.core.XmppException
imageData - The avatar image data, which must be in PNG format.rocks.xmpp.core.stanza.model.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.rocks.xmpp.core.XmppExceptionpublic void addAvatarChangeListener(AvatarChangeListener avatarChangeListener)
avatarChangeListener - The avatar listener.public void removeAvatarChangeListener(AvatarChangeListener avatarChangeListener)
avatarChangeListener - The avatar listener.Copyright © 2014 XMPP.rocks. All rights reserved.