This commit is contained in:
JC Brand 2019-12-03 11:31:28 +01:00
parent 5809c97828
commit 7fc3151e56
3 changed files with 4 additions and 2 deletions

View File

@ -90,7 +90,7 @@ converse.plugins.add('converse-bosh', {
_converse.restoreBOSHSession = async function () {
const jid = (await initBOSHSession()).get('jid');
if (jid) {
if (jid && (_converse.connection._proto instanceof Strophe.Bosh)) {
try {
_converse.connection.restore(jid, _converse.onConnectStatusChanged);
return true;

View File

@ -1397,7 +1397,8 @@ _converse.api = {
}
// See whether there is a BOSH session to re-attach to
if (_.invoke(_converse.pluggable.plugins['converse-bosh'], 'enabled')) {
const bosh_plugin = _converse.pluggable.plugins['converse-bosh'];
if (bosh_plugin && bosh_plugin.enabled()) {
if (await _converse.restoreBOSHSession()) {
return;
} else if (_converse.authentication === _converse.PREBIND && (!automatic || _converse.auto_login)) {

View File

@ -27,6 +27,7 @@
muc_respect_autojoin: true,
view_mode: 'fullscreen',
websocket_url: 'ws://chat.example.org:5380/xmpp-websocket',
// bosh_service_url: 'http://chat.example.org:5280/http-bind',
muc_show_logs_before_join: true,
whitelisted_plugins: ['converse-debug'],
});