Reputation: 131
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
Upvotes: 4
Views: 5377
Reputation: 131
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 :)
Upvotes: 0
Reputation: 16446
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
Upvotes: 3