i´m creating a chat, well.. on the first session i retrieve all roster's account, second i close this session and open other session and i retrieve all roster's first account. i'm working with sockets.
simpleXMMP.connect({ jid: user, password: passs, host: HOST }) ;
i´m creating a chat, well.. on the first session i retrieve all roster's account, second i close this session and open other session and i retrieve all roster's first account. i'm working with sockets.
simpleXMMP.connect({ jid: user, password: passs, host: HOST }) ;
io.sockets.on('connection', function(socket) { simpleXMMP.getRoster(); });
simpleXMMP.on('stanza', function(stanza) { if (stanza.id == 'roster_0') { //CONTACTS var rosters = []; stanza.children[0].children.forEach(function(element, index) { var roster = { jid: element.attrs.jid, name: element.attrs.name, subscription: element.attrs.subscription }; rosters.push(roster); }); io.sockets.on('connect', function(socket) { socket.emit('roster', rosters); }) } });