Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.login = function(jid, password) {
client = XMPP.createClient({
jid: jid,
password: password,
// If you have a .well-known/host-meta.json file for your
// domain, the connection transport config can be skipped.
transport: 'bosh',
boshURL: 'http://ums.ihs.broadsoft.com:5280'
// (or `boshURL` if using 'bosh' as the transport)
});
return client;
};
function (cb) {
app.state = new AppState();
app.me = window.me = new MeModel(profile);
window.onbeforeunload = function () {
if (app.api.sessionStarted) {
app.api.disconnect();
}
};
self.api = window.client = StanzaIO.createClient(config);
client.use(pushNotifications);
xmppEventHandlers(self.api, self);
self.api.once('session:started', function () {
app.state.hasConnected = true;
cb();
});
self.api.connect();
},
function (cb) {