Skip to content

Commit

Permalink
feat(xmpp) remove support for the deprecated options.bosh
Browse files Browse the repository at this point in the history
Yeah, > 4 years seems like ample time :-)
  • Loading branch information
saghul authored and subhamcyara committed Jul 19, 2024
1 parent 67d61a3 commit 62590cb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/xmpp/xmpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export default class XMPP extends Listenable {
* @param {Object} options
* @param {String} options.serviceUrl - URL passed to the XMPP client which will be used to establish XMPP
* connection with the server.
* @param {String} options.bosh - Deprecated, use {@code serviceUrl}.
* @param {boolean} options.enableWebsocketResume - Enables XEP-0198 stream management which will make the XMPP
* module try to resume the session in case the Websocket connection breaks.
* @param {number} [options.websocketKeepAlive] - The websocket keep alive interval. See {@link XmppConnection}
Expand All @@ -132,6 +131,11 @@ export default class XMPP extends Listenable {
*/
constructor(options, token) {
super();

if (options.bosh && !options.serviceUrl) {
throw new Error('The "bosh" option is no longer supported, please use "serviceUrl" instead');
}

this.connection = null;
this.disconnectInProgress = false;
this.connectionTimes = {};
Expand All @@ -155,9 +159,7 @@ export default class XMPP extends Listenable {

this.connection = createConnection({
enableWebsocketResume: options.enableWebsocketResume,

// FIXME remove deprecated bosh option at some point
serviceUrl: options.serviceUrl || options.bosh,
serviceUrl: options.serviceUrl,
token,
websocketKeepAlive: options.websocketKeepAlive,
websocketKeepAliveUrl: options.websocketKeepAliveUrl,
Expand Down

0 comments on commit 62590cb

Please sign in to comment.