Question

I am creating a text chat application and using Ejabberd server and strophe.js.

I am using mssql as a external database for ejabberd. I transferred all the application users in users table and freinds in rosterusers table of ejabberd.

I want to specify the profile image url of application as a avatar image of ejabberd user.

Where to insert the avatar URL in ejabberd database ? I checked vcard table but no column for avatar image url ?

Can we handle it using the ejabberd database or ejabberd is managing avatars internally ?

If we can't manage the avatars in ejabberd than how can we use it with strophe.js i.e. sepcify the avatar image and receive other roster items avatar image ?

Please help

Was it helpful?

Solution 2

Set VCard Image from URL:

I know the profile image of user and after making the connection to the ejabberd server using strophe i am setting profile image in vcard using the strophe stanza.

Below is example of setting the image url in the vcard:

iq = $iq({ type: 'set', to: currentUserObj.jabberid+ "@" + CDomain }).c('vCard', { xmlns:'vcard-temp' }).c('PHOTO').c('EXTVAL', currentUserObj.profileImg);

connection.sendIQ(iq);

Hope it'll help someone :)

OTHER TIPS

I believe you can use the command ejabberctl from the command line to load avatar URLs into a user's vcard.

ejabberdctl set_vcard foo chat.myjabber.com PHOTO http://link_to_image.jpg
ejabberdctl set_vcard2 foo chat.myjabber.com PHOTO EXTVAL http://link_to_image.jpg
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top