Vivek Mohan
Vivek Mohan

Reputation: 43

Ejabberd- set vard for other user

Is it possible to add a vcard for some other jabber user in ejabberd. I am logged in as [email protected]. While creating users in my website i am registering a jabber account for the same user. Now i need to add vcards for those users. While trying to add vcard for a new user, i can see that the vcard entry is added to the currently logged in user(in my case it is [email protected]). I am using strophe library and the code used for adding vcard is as follows.

iq = $iq({ type: 'set', to: '[email protected]' }).c('vCard', { xmlns:'vcard-temp' }).c('PHOTO').c('EXTVAL', 'http://image_url/image.jpg'); conn.sendIQ(iq);

But i can achieve the same using ejabberdctl set_vcard jabber_id domain PHOTO img.jpg from CLI

The purpose is to add profile images to users. I have the profile images saved in my server for each users registered in my site. Currently i am doing an ajax call for fetching the user profile image. Is there any alternative for this? Any help will be really appreciable.

Upvotes: 0

Views: 393

Answers (1)

Mickaël Rémond
Mickaël Rémond

Reputation: 9055

XMPP protocol does not define a way to edit vcard for other users and ejabberd does not implement something special to allow this.

You can use a database backend for Vcard or write a custom Vcard backend plugin to suit your needs.

Upvotes: 1

Related Questions