* @param itemId The item id.
* @param info The info element.
* @throws rocks.xmpp.core.XmppException If an XMPP exception occurs.
*/
private void publishToPersonalEventingService(byte[] avatar, String itemId, AvatarMetadata.Info info) throws XmppException {
PubSubService personalEventingService = xmppSession.getExtensionManager(PubSubManager.class).createPersonalEventingService();
if (avatar != null) {
if (info.getUrl() == null) {
// Publish image.
personalEventingService.getNode(AvatarData.NAMESPACE).publish(itemId, new AvatarData(avatar));
}
// Publish meta data.
personalEventingService.getNode(AvatarMetadata.NAMESPACE).publish(itemId, new AvatarMetadata(info));
} else {
personalEventingService.getNode(AvatarMetadata.NAMESPACE).publish(itemId, new AvatarMetadata());
}
}