[JDEV] setting a user's vcard from within a component

Peter Millard me at pgmillard.com
Tue Nov 18 09:44:05 CST 2003


Stefan Strigler wrote:
> I'm trying to develop a module for the wcs component which should enable
> a user to set his/her vcard. For this I am creating an iq packet like
> this:
>  <iq type='set'><vcard xmlns='vcard-temp'><FN>bruno</FN></vcard></iq>
> This one gives my an error (to/from missing):

Yes. Components must always create packets with valid to and from addresses on
the main stanza element. In the case of a vcard set, the to attribute should be
the jid of the user you're trying to change, and the from address should be the

<iq type="set" to="foo at bar.com" from="your-component">...</iq>

That said, I'm not sure JSM will allow this to work correctly. IE, mod_vcard
probably has some checks to make sure only the user is allowed to change their
own vcard. You could of-course change mod_vcard to allow packets from your
component.

pgm.






More information about the JDev mailing list