Selaa lähdekoodia

fix(JitsiConference) simplify auth-and-upgrade procedure

It's not necessary to perform a full join, sending a conference IQ is
enough.
dev1
Saúl Ibarra Corretgé 3 vuotta sitten
vanhempi
commit
9c999accc1
2 muutettua tiedostoa jossa 4 lisäystä ja 11 poistoa
  1. 3
    8
      authenticateAndUpgradeRole.js
  2. 1
    3
      types/auto/authenticateAndUpgradeRole.d.ts

+ 3
- 8
authenticateAndUpgradeRole.js Näytä tiedosto

40
  * @param {string} options.id - XMPP user's ID to log in. For example,
40
  * @param {string} options.id - XMPP user's ID to log in. For example,
41
  * user@xmpp-server.com.
41
  * user@xmpp-server.com.
42
  * @param {string} options.password - XMPP user's password to log in with.
42
  * @param {string} options.password - XMPP user's password to log in with.
43
- * @param {string} [options.roomPassword] - The password to join the MUC with.
44
  * @param {Function} [options.onLoginSuccessful] - Callback called when logging
43
  * @param {Function} [options.onLoginSuccessful] - Callback called when logging
45
  * into the XMPP server was successful. The next step will be to obtain a new
44
  * into the XMPP server was successful. The next step will be to obtain a new
46
  * session ID from Jicofo and join the MUC using it which will effectively
45
  * session ID from Jicofo and join the MUC using it which will effectively
65
 
64
 
66
     // 2. Let the API client/consumer know as soon as the XMPP user has been
65
     // 2. Let the API client/consumer know as soon as the XMPP user has been
67
     //    successfully logged in.
66
     //    successfully logged in.
68
-    onLoginSuccessful,
69
-
70
-    // 3. Join the MUC.
71
-    roomPassword
67
+    onLoginSuccessful
72
 }) {
68
 }) {
73
     let canceled = false;
69
     let canceled = false;
74
     let rejectPromise;
70
     let rejectPromise;
112
                         }
108
                         }
113
 
109
 
114
                         // At this point we should have the new session ID
110
                         // At this point we should have the new session ID
115
-                        // stored in the settings. Jicofo will allow to join the
116
-                        // room.
117
-                        this.join(roomPassword);
111
+                        // stored in the settings. Send a new conference IQ.
112
+                        this.room.moderator.allocateConferenceFocus();
118
 
113
 
119
                         resolve();
114
                         resolve();
120
                     })
115
                     })

+ 1
- 3
types/auto/authenticateAndUpgradeRole.d.ts Näytä tiedosto

30
  * @param {string} options.id - XMPP user's ID to log in. For example,
30
  * @param {string} options.id - XMPP user's ID to log in. For example,
31
  * user@xmpp-server.com.
31
  * user@xmpp-server.com.
32
  * @param {string} options.password - XMPP user's password to log in with.
32
  * @param {string} options.password - XMPP user's password to log in with.
33
- * @param {string} [options.roomPassword] - The password to join the MUC with.
34
  * @param {Function} [options.onLoginSuccessful] - Callback called when logging
33
  * @param {Function} [options.onLoginSuccessful] - Callback called when logging
35
  * into the XMPP server was successful. The next step will be to obtain a new
34
  * into the XMPP server was successful. The next step will be to obtain a new
36
  * session ID from Jicofo and join the MUC using it which will effectively
35
  * session ID from Jicofo and join the MUC using it which will effectively
47
  * thenable will be rejected with an empty object (i.e. no error property will
46
  * thenable will be rejected with an empty object (i.e. no error property will
48
  * be set on the rejection reason).
47
  * be set on the rejection reason).
49
  */
48
  */
50
-export default function authenticateAndUpgradeRole({ id, password, onCreateResource, onLoginSuccessful, roomPassword }: {
49
+export default function authenticateAndUpgradeRole({ id, password, onCreateResource, onLoginSuccessful }: {
51
     id: string;
50
     id: string;
52
     password: string;
51
     password: string;
53
-    roomPassword?: string;
54
     onLoginSuccessful?: Function;
52
     onLoginSuccessful?: Function;
55
 }): any;
53
 }): any;
56
 export type UpgradeRoleError = {
54
 export type UpgradeRoleError = {

Loading…
Peruuta
Tallenna