Commit 714da6f0 authored by JC Brand's avatar JC Brand

Wait until push services are disabled as well

parent 7109ff67
......@@ -57676,20 +57676,22 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
const enabled_services = _.reject(_converse.push_app_servers, 'disable');
const disabled_services = _.filter(_converse.push_app_servers, 'disable');
try {
await Promise.all(_.map(enabled_services, _.partial(enablePushAppServer, domain)));
const enabled = _.map(enabled_services, _.partial(enablePushAppServer, domain));
const disabled = _.map(disabled_services, _.partial(disablePushAppServer, domain));
await Promise.all(enabled.concat(disabled));
} catch (e) {
_converse.log('Could not enable push App Server', Strophe.LogLevel.ERROR);
_converse.log('Could not enable or disable push App Server', Strophe.LogLevel.ERROR);
if (e) _converse.log(e, Strophe.LogLevel.ERROR);
} finally {
push_enabled.push(domain);
}
const disabled_services = _.filter(_converse.push_app_servers, 'disable');
_.each(disabled_services, _.partial(disablePushAppServer, domain));
_converse.session.save('push_enabled', push_enabled);
}
......@@ -114,7 +114,7 @@
`<iq id="${stanza.getAttribute('id')}" type="set" xmlns="jabber:client">`+
'<disable jid="push-5@client.example" node="yxs32uqsflafdk3iuqo" xmlns="urn:xmpp:push:0"/>'+
'</iq>'
)
);
_converse.connection._dataRecv(test_utils.createRequest($iq({
'to': _converse.connection.jid,
'type': 'result',
......
......@@ -106,16 +106,17 @@ converse.plugins.add('converse-push', {
return;
}
const enabled_services = _.reject(_converse.push_app_servers, 'disable');
const disabled_services = _.filter(_converse.push_app_servers, 'disable');
try {
await Promise.all(_.map(enabled_services, _.partial(enablePushAppServer, domain)))
const enabled = _.map(enabled_services, _.partial(enablePushAppServer, domain));
const disabled = _.map(disabled_services, _.partial(disablePushAppServer, domain));
await Promise.all(enabled.concat(disabled));
} catch (e) {
_converse.log('Could not enable push App Server', Strophe.LogLevel.ERROR);
_converse.log('Could not enable or disable push App Server', Strophe.LogLevel.ERROR);
if (e) _converse.log(e, Strophe.LogLevel.ERROR);
} finally {
push_enabled.push(domain);
}
const disabled_services = _.filter(_converse.push_app_servers, 'disable');
_.each(disabled_services, _.partial(disablePushAppServer, domain));
_converse.session.save('push_enabled', push_enabled);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment