|
|
@@ -54,11 +54,24 @@ export default function JitsiConnection(appID, token, options) {
|
|
54
|
54
|
|
|
55
|
55
|
/**
|
|
56
|
56
|
* Connect the client with the server.
|
|
57
|
|
- * @param options {object} connecting options
|
|
58
|
|
- * (for example authentications parameters).
|
|
|
57
|
+ * @param options {object} connecting options (for example authentications parameters).
|
|
|
58
|
+ * @param options.id {string} The username to use when connecting, if any.
|
|
|
59
|
+ * @param options.password {string} The password to use when connecting with username, if any.
|
|
|
60
|
+ * @param options.name {string} The name of the room/conference we will be connecting to. This is needed on connection
|
|
|
61
|
+ * time to be able to send conference-request over http. If missing the flow where we send conference-iq to jicofo over
|
|
|
62
|
+ * the established xmpp connection will be used, even in the case where we have configured conference http request url
|
|
|
63
|
+ * to be used.
|
|
59
|
64
|
*/
|
|
60
|
65
|
JitsiConnection.prototype.connect = function(options = {}) {
|
|
61
|
|
- this.xmpp.connect(options.id, options.password);
|
|
|
66
|
+ // if we get redirected, we set disableFocus to skip sending the conference request twice
|
|
|
67
|
+ if (this.xmpp.moderator.targetUrl && !this.options.disableFocus && options.name) {
|
|
|
68
|
+ this.xmpp.moderator.sendConferenceRequest(this.xmpp.getRoomJid(options.name))
|
|
|
69
|
+ .then(() => {
|
|
|
70
|
+ this.xmpp.connect(options.id, options.password);
|
|
|
71
|
+ });
|
|
|
72
|
+ } else {
|
|
|
73
|
+ this.xmpp.connect(options.id, options.password);
|
|
|
74
|
+ }
|
|
62
|
75
|
};
|
|
63
|
76
|
|
|
64
|
77
|
/**
|