Execute manual resource binding if necessary
This commit is contained in:
parent
0688907e0d
commit
24956d8dca
|
@ -849,6 +849,8 @@ _converse.initialize = async function (settings, callback) {
|
||||||
} else if (status === Strophe.Status.DISCONNECTED) {
|
} else if (status === Strophe.Status.DISCONNECTED) {
|
||||||
_converse.setDisconnectionCause(status, message);
|
_converse.setDisconnectionCause(status, message);
|
||||||
_converse.onDisconnected();
|
_converse.onDisconnected();
|
||||||
|
} else if (status === Strophe.Status.BINDREQUIRED) {
|
||||||
|
_converse.bindResource();
|
||||||
} else if (status === Strophe.Status.ERROR) {
|
} else if (status === Strophe.Status.ERROR) {
|
||||||
_converse.setConnectionStatus(
|
_converse.setConnectionStatus(
|
||||||
status,
|
status,
|
||||||
|
@ -1089,6 +1091,16 @@ _converse.initialize = async function (settings, callback) {
|
||||||
_converse.api.trigger('setUserJID');
|
_converse.api.trigger('setUserJID');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.bindResource = async function () {
|
||||||
|
/**
|
||||||
|
* Synchronous event triggered before we send an IQ to bind the user's
|
||||||
|
* JID resource for this session.
|
||||||
|
* @event _converse#beforeResourceBinding
|
||||||
|
*/
|
||||||
|
await _converse.api.trigger('beforeResourceBinding', {'synchronous': true});
|
||||||
|
_converse.connection.bind();
|
||||||
|
};
|
||||||
|
|
||||||
this.onConnected = function (reconnecting) {
|
this.onConnected = function (reconnecting) {
|
||||||
/* Called as soon as a new connection has been established, either
|
/* Called as soon as a new connection has been established, either
|
||||||
* by logging in or by attaching to an existing BOSH session.
|
* by logging in or by attaching to an existing BOSH session.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user