Rajamohan Sugumaran Rajamohan Sugumaran - 5 months ago 33
jQuery Question

how to create new group in xmpp server

Am using Strophe.js library for communication between my application with XMPP(Openfire) server.

I want add user with group,
How can i create new group?
How can i mention group name with add buddy query?

This is my code for adding new user

var str1=$pres({'xmlns':'jabber:client','from':xxx@example.com,'to':yyy@example.com,'type':'subscribe'}).c('nick',{'xmlns':'http://jabber.org/protocol/nick'}).t(userName);

I refer XMPP extension over day but i cant find proper result


You need to send a roster update. Read RFC 6121, Section 2 for details. You'll be sending this protocol:

<iq from='juliet@example.com/balcony'
   <query xmlns='jabber:iq:roster'>
     <item jid='yyy@example.com' name='nick'>
        <group>My Group</group>

With code something like:

   .c('item', {'jid':'yyy@example.com','name':'nick'})
       .c('group').t('My Group')