Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

problems with Roster #69

Open
jlveliz opened this issue Dec 17, 2015 · 0 comments
Open

problems with Roster #69

jlveliz opened this issue Dec 17, 2015 · 0 comments

Comments

@jlveliz
Copy link

jlveliz commented Dec 17, 2015

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); }) } });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant