Przeglądaj źródła

Updates app.bundle.js

j8
paweldomas 10 lat temu
rodzic
commit
8956002de5
2 zmienionych plików z 34 dodań i 5 usunięć
  1. 1
    1
      index.html
  2. 33
    4
      libs/app.bundle.js

+ 1
- 1
index.html Wyświetl plik

20
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
21
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
22
     <script src="interface_config.js?v=5"></script>
22
     <script src="interface_config.js?v=5"></script>
23
-    <script src="libs/app.bundle.js?v=131"></script>
23
+    <script src="libs/app.bundle.js?v=132"></script>
24
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
25
     <link rel="stylesheet" href="css/font.css?v=7"/>
25
     <link rel="stylesheet" href="css/font.css?v=7"/>
26
     <link rel="stylesheet" href="css/toastr.css?v=1">
26
     <link rel="stylesheet" href="css/toastr.css?v=1">

+ 33
- 4
libs/app.bundle.js Wyświetl plik

3577
 
3577
 
3578
     APP.xmpp.addListener(XMPPEvents.ROOM_JOIN_ERROR, function (pres) {
3578
     APP.xmpp.addListener(XMPPEvents.ROOM_JOIN_ERROR, function (pres) {
3579
         UI.messageHandler.openReportDialog(null,
3579
         UI.messageHandler.openReportDialog(null,
3580
-            "dialog.joinError", pres);
3580
+            "dialog.connectError", pres);
3581
     });
3581
     });
3582
     APP.xmpp.addListener(XMPPEvents.ROOM_CONNECT_ERROR, function (pres) {
3582
     APP.xmpp.addListener(XMPPEvents.ROOM_CONNECT_ERROR, function (pres) {
3583
         UI.messageHandler.openReportDialog(null,
3583
         UI.messageHandler.openReportDialog(null,
12501
         this.userID =  APP.xmpp.myResource();
12501
         this.userID =  APP.xmpp.myResource();
12502
 
12502
 
12503
         var location = window.location;
12503
         var location = window.location;
12504
-        this.confID = location.protocol + "//" +
12505
-            location.hostname + location.pathname;
12504
+        this.confID = location.hostname + location.pathname;
12506
 
12505
 
12507
         //userID is generated or given by the origin server
12506
         //userID is generated or given by the origin server
12508
         callStats.initialize(config.callStatsID,
12507
         callStats.initialize(config.callStatsID,
18895
             this.connection.sendIQ(iq, success, error, timeout);
18894
             this.connection.sendIQ(iq, success, error, timeout);
18896
         },
18895
         },
18897
 
18896
 
18897
+        /**
18898
+         * Checks if given <tt>jid</tt> has XEP-0199 ping support.
18899
+         * @param jid the JID to be checked for ping support.
18900
+         * @param callback function with boolean argument which will be
18901
+         * <tt>true</tt> if XEP-0199 ping is supported by given <tt>jid</tt>
18902
+         */
18903
+        hasPingSupport: function (jid, callback) {
18904
+            this.connection.disco.info(
18905
+                jid, null,
18906
+                function (result) {
18907
+                    var ping = $(result).find('>>feature[var="urn:xmpp:ping"]');
18908
+                    callback(ping.length > 0);
18909
+                },
18910
+                function (error) {
18911
+                    console.error("Ping feature discovery error", error);
18912
+                    callback(false);
18913
+                }
18914
+            );
18915
+        },
18916
+
18898
         /**
18917
         /**
18899
          * Starts to send ping in given interval to specified remote JID.
18918
          * Starts to send ping in given interval to specified remote JID.
18900
          * This plugin supports only one such task and <tt>stopInterval</tt>
18919
          * This plugin supports only one such task and <tt>stopInterval</tt>
19173
 
19192
 
19174
                 console.info("My Jabber ID: " + connection.jid);
19193
                 console.info("My Jabber ID: " + connection.jid);
19175
 
19194
 
19176
-                connection.ping.startInterval(config.hosts.domain);
19195
+                // Schedule ping ?
19196
+                var pingJid = connection.domain;
19197
+                connection.ping.hasPingSupport(
19198
+                    pingJid,
19199
+                    function (hasPing) {
19200
+                        if (hasPing)
19201
+                            connection.ping.startInterval(pingJid);
19202
+                        else
19203
+                            console.warn("Ping NOT supported by " + pingJid);
19204
+                    }
19205
+                );
19177
 
19206
 
19178
                 if (password)
19207
                 if (password)
19179
                     authenticatedUser = true;
19208
                     authenticatedUser = true;

Ładowanie…
Anuluj
Zapisz