Set BOSH wait period to 59 seconds also when attaching to a session

This commit is contained in:
JC Brand 2022-01-25 13:10:48 +01:00
parent 46a5a64dda
commit 007b4bce2f
3 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,7 @@
*/ */
import 'strophe.js/src/bosh'; import 'strophe.js/src/bosh';
import log from "../log.js"; import log from "../log.js";
import { BOSH_WAIT } from '@converse/headless/shared/constants.js';
import { Model } from '@converse/skeletor/src/model.js'; import { Model } from '@converse/skeletor/src/model.js';
import { _converse, api, converse } from "../core.js"; import { _converse, api, converse } from "../core.js";
import { setUserJID, } from '@converse/headless/utils/init.js'; import { setUserJID, } from '@converse/headless/utils/init.js';
@ -63,7 +64,8 @@ converse.plugins.add('converse-bosh', {
jid, jid,
data.sid, data.sid,
data.rid, data.rid,
_converse.connection.onConnectStatusChanged _converse.connection.onConnectStatusChanged,
BOSH_WAIT
); );
} else { } else {
xhr.onerror(); xhr.onerror();

View File

@ -6,8 +6,7 @@ import { Strophe } from 'strophe.js/src/core';
import { _converse, api, clearSession, tearDown } from "../core.js"; import { _converse, api, clearSession, tearDown } from "../core.js";
import { getOpenPromise } from '@converse/openpromise'; import { getOpenPromise } from '@converse/openpromise';
import { setUserJID, } from '@converse/headless/utils/init.js'; import { setUserJID, } from '@converse/headless/utils/init.js';
import { BOSH_WAIT } from '@converse/headless/shared/constants.js';
const BOSH_WAIT = 59;
/** /**

View File

@ -1,5 +1,7 @@
import { Strophe } from 'strophe.js/src/strophe'; import { Strophe } from 'strophe.js/src/strophe';
export const BOSH_WAIT = 59;
export const CONNECTION_STATUS = {}; export const CONNECTION_STATUS = {};
CONNECTION_STATUS[Strophe.Status.ATTACHED] = 'ATTACHED'; CONNECTION_STATUS[Strophe.Status.ATTACHED] = 'ATTACHED';
CONNECTION_STATUS[Strophe.Status.AUTHENTICATING] = 'AUTHENTICATING'; CONNECTION_STATUS[Strophe.Status.AUTHENTICATING] = 'AUTHENTICATING';