Commit 21dfd8a3 authored by JC Brand's avatar JC Brand

Bugfix: Set protocol after discovering connection methods

Otherwise if an endpoint was passed in with `converse.initialize`, then
that endpoint's protocol is (wrongly) used.
parent f5707c51
This diff is collapsed.
...@@ -53,6 +53,7 @@ export class Connection extends Strophe.Connection { ...@@ -53,6 +53,7 @@ export class Connection extends Strophe.Connection {
api.settings.set("websocket_url", ws_methods.pop()); api.settings.set("websocket_url", ws_methods.pop());
api.settings.set('bosh_service_url', bosh_methods.pop()); api.settings.set('bosh_service_url', bosh_methods.pop());
this.service = api.settings.get("websocket_url") || api.settings.get('bosh_service_url'); this.service = api.settings.get("websocket_url") || api.settings.get('bosh_service_url');
this.setProtocol();
} }
} }
......
...@@ -789,7 +789,6 @@ export const api = _converse.api = { ...@@ -789,7 +789,6 @@ export const api = _converse.api = {
listen: { listen: {
/** /**
* Lets you listen to an event exactly once. * Lets you listen to an event exactly once.
*
* @method _converse.api.listen.once * @method _converse.api.listen.once
* @param {string} name The event's name * @param {string} name The event's name
* @param {function} callback The callback method to be called when the event is emitted. * @param {function} callback The callback method to be called when the event is emitted.
...@@ -800,9 +799,7 @@ export const api = _converse.api = { ...@@ -800,9 +799,7 @@ export const api = _converse.api = {
/** /**
* Lets you subscribe to an event. * Lets you subscribe to an event.
*
* Every time the event fires, the callback method specified by `callback` will be called. * Every time the event fires, the callback method specified by `callback` will be called.
*
* @method _converse.api.listen.on * @method _converse.api.listen.on
* @param {string} name The event's name * @param {string} name The event's name
* @param {function} callback The callback method to be called when the event is emitted. * @param {function} callback The callback method to be called when the event is emitted.
...@@ -813,9 +810,6 @@ export const api = _converse.api = { ...@@ -813,9 +810,6 @@ export const api = _converse.api = {
/** /**
* To stop listening to an event, you can use the `not` method. * To stop listening to an event, you can use the `not` method.
*
* Every time the event fires, the callback method specified by `callback` will be called.
*
* @method _converse.api.listen.not * @method _converse.api.listen.not
* @param {string} name The event's name * @param {string} name The event's name
* @param {function} callback The callback method that is to no longer be called when the event fires * @param {function} callback The callback method that is to no longer be called when the event fires
......
...@@ -43,6 +43,6 @@ ...@@ -43,6 +43,6 @@
"lodash-es": "^4.17.15", "lodash-es": "^4.17.15",
"pluggable.js": "2.0.1", "pluggable.js": "2.0.1",
"sprintf-js": "^1.1.2", "sprintf-js": "^1.1.2",
"strophe.js": "1.4.0" "strophe.js": "strophe/strophejs#4f9b094ecef4be0d473f92965c5ffb654510a598"
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment