Skip to content

Commit

Permalink
bosh: only advertise support if the module is enabled
Browse files Browse the repository at this point in the history
updates #1725
  • Loading branch information
jcbrand committed Sep 24, 2019
1 parent bce8dc9 commit 44e5b4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/headless/converse-bosh.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @description
* Converse.js plugin which add support for XEP-0206: XMPP Over BOSH
*/
import 'strophe.js/src/bosh';
import BrowserStorage from "backbone.browserStorage";
import converse from "./converse-core";

Expand Down Expand Up @@ -117,6 +118,11 @@ converse.plugins.add('converse-bosh', {
_converse.bosh_session.save({'jid': _converse.jid});
}
});

_converse.api.listen.on('addClientFeatures',
() => _converse.api.disco.own.features.add(Strophe.NS.BOSH)
);

/************************ END Event Handlers ************************/


Expand Down
1 change: 0 additions & 1 deletion src/headless/converse-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
/**
* @module converse-core
*/
import 'strophe.js/src/bosh';
import 'strophe.js/src/websocket';
import * as strophe from 'strophe.js/src/core';
import Backbone from 'backbone';
Expand Down
1 change: 0 additions & 1 deletion src/headless/converse-disco.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ converse.plugins.add('converse-disco', {
// See https://xmpp.org/registrar/disco-categories.html
_converse.api.disco.own.identities.add('client', 'web', 'Converse');

_converse.api.disco.own.features.add(Strophe.NS.BOSH);
_converse.api.disco.own.features.add(Strophe.NS.CHATSTATES);
_converse.api.disco.own.features.add(Strophe.NS.DISCO_INFO);
_converse.api.disco.own.features.add(Strophe.NS.ROSTERX); // Limited support
Expand Down

0 comments on commit 44e5b4c

Please sign in to comment.