I need to create a Private and Persistent Chat room dynamically via Node that does not automatically delete itself.
I've searched the net and couldn't find much on how to do it. This is the code snippet I use to create the chatroom:
var cl = new xmpp.Client({
jid: jabber_creds.jid,
password: jabber_creds.password,
host: jabber_creds.host,
port: jabber_creds.port
});
cl.on('online', function() {
var room_jid = jabber_creds.room_jid.replace("%s", chatRoomName);
// join room (and request no chat history)
cl.send(new xmpp.Element('presence', { to: room_jid }).
c('x', { xmlns: 'http://jabber.org/protocol/muc' })
);
// create room
cl.send(new xmpp.Element('iq', { to: room_jid, id: 'create', type: 'set' }).
c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }).
c('x', { xmlns: 'jabber:x:data',type: 'submit' })
);
});
Chat room persistence is handled at the server not the client. Yes the client can request that a server hold onto a chat room but you can't actually persist it from the client. Check with the server documentation that you are using to make sure it supports this.