Kaynağa Gözat

fix(JitsiConference) simplify auth-and-upgrade procedure

It's not necessary to perform a full join, sending a conference IQ is
enough.
tags/v0.0.2
Saúl Ibarra Corretgé 2 yıl önce
ebeveyn
işleme
9c999accc1

+ 3
- 8
authenticateAndUpgradeRole.js Dosyayı Görüntüle

@@ -40,7 +40,6 @@ import XMPP from './modules/xmpp/xmpp';
40 40
  * @param {string} options.id - XMPP user's ID to log in. For example,
41 41
  * user@xmpp-server.com.
42 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 43
  * @param {Function} [options.onLoginSuccessful] - Callback called when logging
45 44
  * into the XMPP server was successful. The next step will be to obtain a new
46 45
  * session ID from Jicofo and join the MUC using it which will effectively
@@ -65,10 +64,7 @@ export default function authenticateAndUpgradeRole({
65 64
 
66 65
     // 2. Let the API client/consumer know as soon as the XMPP user has been
67 66
     //    successfully logged in.
68
-    onLoginSuccessful,
69
-
70
-    // 3. Join the MUC.
71
-    roomPassword
67
+    onLoginSuccessful
72 68
 }) {
73 69
     let canceled = false;
74 70
     let rejectPromise;
@@ -112,9 +108,8 @@ export default function authenticateAndUpgradeRole({
112 108
                         }
113 109
 
114 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 114
                         resolve();
120 115
                     })

+ 1
- 3
types/auto/authenticateAndUpgradeRole.d.ts Dosyayı Görüntüle

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

Loading…
İptal
Kaydet