|
@@ -3577,7 +3577,7 @@ function registerListeners() {
|
3577
|
3577
|
|
3578
|
3578
|
APP.xmpp.addListener(XMPPEvents.ROOM_JOIN_ERROR, function (pres) {
|
3579
|
3579
|
UI.messageHandler.openReportDialog(null,
|
3580
|
|
- "dialog.joinError", pres);
|
|
3580
|
+ "dialog.connectError", pres);
|
3581
|
3581
|
});
|
3582
|
3582
|
APP.xmpp.addListener(XMPPEvents.ROOM_CONNECT_ERROR, function (pres) {
|
3583
|
3583
|
UI.messageHandler.openReportDialog(null,
|
|
@@ -12501,8 +12501,7 @@ var CallStats = {
|
12501
|
12501
|
this.userID = APP.xmpp.myResource();
|
12502
|
12502
|
|
12503
|
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
|
12506
|
//userID is generated or given by the origin server
|
12508
|
12507
|
callStats.initialize(config.callStatsID,
|
|
@@ -18895,6 +18894,26 @@ module.exports = function (XMPP, eventEmitter) {
|
18895
|
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
|
18918
|
* Starts to send ping in given interval to specified remote JID.
|
18900
|
18919
|
* This plugin supports only one such task and <tt>stopInterval</tt>
|
|
@@ -19173,7 +19192,17 @@ function connect(jid, password) {
|
19173
|
19192
|
|
19174
|
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
|
19207
|
if (password)
|
19179
|
19208
|
authenticatedUser = true;
|