Open soichih opened 10 years ago
I wonder too...
You can always just proxy to node-xmpp using xmpp.conn
if you wanted.
note: this is untested code
var xmpp = require('simple-xmpp');
var stanza = new xmpp.Element('iq', {from: 'me@my.server', to: 'room@chat.server', type: 'get', id: 'muc_id'}).c('query', { xmlns: 'http://jabber.org/protocol/disco#items'});
xmpp.conn.send(stanza);
xmpp.on('stanza', function(stanza) {
if(stanza.name == 'iq' && stanza.attrs.type == 'result' && stanza.attrs.id == 'muc_id') {
// stanza.children[0].children should have your users available in the room
}
});
You can check out the implementation here
I have written a XMPP bot that lives in our MUC chatroom. I am wondering if there is a way to detect who are currently in the XMPP chatroom with simple-xmpp.
Thanks!