Procházet zdrojové kódy

Fixes authentication issues.

j8
hristoterezov před 10 roky
rodič
revize
4bb555e4b2
2 změnil soubory, kde provedl 26 přidání a 20 odebrání
  1. 13
    10
      libs/app.bundle.js
  2. 13
    10
      modules/xmpp/xmpp.js

+ 13
- 10
libs/app.bundle.js Zobrazit soubor

@@ -15676,19 +15676,22 @@ var authenticatedUser = false;
15676 15676
 
15677 15677
 function connect(jid, password, uiCredentials) {
15678 15678
     var bosh
15679
-        = uiCredentials.bosh || config.bosh || '/http-bind';
15679
+        = (uiCredentials && uiCredentials.bosh? uiCredentials.bosh : null)
15680
+        || config.bosh || '/http-bind';
15680 15681
     connection = new Strophe.Connection(bosh);
15681 15682
     Moderator.setConnection(connection);
15682 15683
 
15683
-    var email = uiCredentials.email;
15684
-    var displayName = uiCredentials.displayName;
15685
-    if(email) {
15686
-        connection.emuc.addEmailToPresence(email);
15687
-    } else {
15688
-        connection.emuc.addUserIdToPresence(uiCredentials.uid);
15689
-    }
15690
-    if(displayName) {
15691
-        connection.emuc.addDisplayNameToPresence(displayName);
15684
+    if(uiCredentials) {
15685
+        var email = uiCredentials.email;
15686
+        var displayName = uiCredentials.displayName;
15687
+        if (email) {
15688
+            connection.emuc.addEmailToPresence(email);
15689
+        } else {
15690
+            connection.emuc.addUserIdToPresence(uiCredentials.uid);
15691
+        }
15692
+        if (displayName) {
15693
+            connection.emuc.addDisplayNameToPresence(displayName);
15694
+        }
15692 15695
     }
15693 15696
 
15694 15697
     if (connection.disco) {

+ 13
- 10
modules/xmpp/xmpp.js Zobrazit soubor

@@ -13,19 +13,22 @@ var authenticatedUser = false;
13 13
 
14 14
 function connect(jid, password, uiCredentials) {
15 15
     var bosh
16
-        = uiCredentials.bosh || config.bosh || '/http-bind';
16
+        = (uiCredentials && uiCredentials.bosh? uiCredentials.bosh : null)
17
+        || config.bosh || '/http-bind';
17 18
     connection = new Strophe.Connection(bosh);
18 19
     Moderator.setConnection(connection);
19 20
 
20
-    var email = uiCredentials.email;
21
-    var displayName = uiCredentials.displayName;
22
-    if(email) {
23
-        connection.emuc.addEmailToPresence(email);
24
-    } else {
25
-        connection.emuc.addUserIdToPresence(uiCredentials.uid);
26
-    }
27
-    if(displayName) {
28
-        connection.emuc.addDisplayNameToPresence(displayName);
21
+    if(uiCredentials) {
22
+        var email = uiCredentials.email;
23
+        var displayName = uiCredentials.displayName;
24
+        if (email) {
25
+            connection.emuc.addEmailToPresence(email);
26
+        } else {
27
+            connection.emuc.addUserIdToPresence(uiCredentials.uid);
28
+        }
29
+        if (displayName) {
30
+            connection.emuc.addDisplayNameToPresence(displayName);
31
+        }
29 32
     }
30 33
 
31 34
     if (connection.disco) {

Načítá se…
Zrušit
Uložit