Skip to content

Commit 44e5b4c

Browse files
committed
bosh: only advertise support if the module is enabled
updates #1725
1 parent bce8dc9 commit 44e5b4c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/headless/converse-bosh.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @description
99
* Converse.js plugin which add support for XEP-0206: XMPP Over BOSH
1010
*/
11+
import 'strophe.js/src/bosh';
1112
import BrowserStorage from "backbone.browserStorage";
1213
import converse from "./converse-core";
1314

@@ -117,6 +118,11 @@ converse.plugins.add('converse-bosh', {
117118
_converse.bosh_session.save({'jid': _converse.jid});
118119
}
119120
});
121+
122+
_converse.api.listen.on('addClientFeatures',
123+
() => _converse.api.disco.own.features.add(Strophe.NS.BOSH)
124+
);
125+
120126
/************************ END Event Handlers ************************/
121127

122128

src/headless/converse-core.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
/**
77
* @module converse-core
88
*/
9-
import 'strophe.js/src/bosh';
109
import 'strophe.js/src/websocket';
1110
import * as strophe from 'strophe.js/src/core';
1211
import Backbone from 'backbone';

src/headless/converse-disco.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ converse.plugins.add('converse-disco', {
246246
// See https://xmpp.org/registrar/disco-categories.html
247247
_converse.api.disco.own.identities.add('client', 'web', 'Converse');
248248

249-
_converse.api.disco.own.features.add(Strophe.NS.BOSH);
250249
_converse.api.disco.own.features.add(Strophe.NS.CHATSTATES);
251250
_converse.api.disco.own.features.add(Strophe.NS.DISCO_INFO);
252251
_converse.api.disco.own.features.add(Strophe.NS.ROSTERX); // Limited support

0 commit comments

Comments
 (0)