Need code for this case

<presence from=''>
  <x xmlns='vcard-temp:x:update'>

How do i send this code in smack format..

I no where found to set these tags in presence.

Thanks in advance.
Nikhil dhiman


broadcasting the SHA-1 of a new avatar is not implemented in Smack but you can create a packet like that with the following code:

// create presence of type available (Presence has no empty constructor)
Presence avatarPresenceBroadcast = new Presence(Presence.Type.available); // build packet extension for vcard-temp:x:update
DefaultPacketExtension vcardExtension = new DefaultPacketExtension("x", "vcard-temp:x:update"); // set content of packet extension
vcardExtension.setValue("photo", "sha1-hash-of-image"); // add packet extension to presence
avatarPresenceBroadcast.addExtension(vcardExtension); // set from (optional)
avatarPresenceBroadcast.setFrom(""); // show presences XML

Best regards,