|
@@ -106,6 +106,11 @@ export default class XMPP extends Listenable {
|
106
|
106
|
|
107
|
107
|
initStropheNativePlugins();
|
108
|
108
|
|
|
109
|
+ const xmppPing = options.xmppPing || {};
|
|
110
|
+
|
|
111
|
+ // let's ping the main domain (in case a guest one is used for the connection)
|
|
112
|
+ xmppPing.domain = options.hosts.domain;
|
|
113
|
+
|
109
|
114
|
this.connection = createConnection({
|
110
|
115
|
enableWebsocketResume: options.enableWebsocketResume,
|
111
|
116
|
|
|
@@ -113,7 +118,7 @@ export default class XMPP extends Listenable {
|
113
|
118
|
serviceUrl: options.serviceUrl || options.bosh,
|
114
|
119
|
token,
|
115
|
120
|
websocketKeepAlive: options.websocketKeepAlive,
|
116
|
|
- xmppPing: options.xmppPing
|
|
121
|
+ xmppPing
|
117
|
122
|
});
|
118
|
123
|
|
119
|
124
|
this._initStrophePlugins();
|
|
@@ -227,15 +232,12 @@ export default class XMPP extends Listenable {
|
227
|
232
|
// XmppConnection emits CONNECTED again on reconnect - a good opportunity to clear any "last error" flags
|
228
|
233
|
this._resetState();
|
229
|
234
|
|
230
|
|
- // Schedule ping ?
|
231
|
|
- const pingJid = this.connection.domain;
|
232
|
|
-
|
233
|
235
|
// FIXME no need to do it again on stream resume
|
234
|
|
- this.caps.getFeaturesAndIdentities(pingJid)
|
|
236
|
+ this.caps.getFeaturesAndIdentities(this.options.hosts.domain)
|
235
|
237
|
.then(({ features, identities }) => {
|
236
|
238
|
if (!features.has(Strophe.NS.PING)) {
|
237
|
|
- logger.error(
|
238
|
|
- `Ping NOT supported by ${pingJid} - please enable ping in your XMPP server config`);
|
|
239
|
+ logger.error(`Ping NOT supported by ${
|
|
240
|
+ this.options.hosts.domain} - please enable ping in your XMPP server config`);
|
239
|
241
|
}
|
240
|
242
|
|
241
|
243
|
// check for speakerstats
|
|
@@ -539,7 +541,7 @@ export default class XMPP extends Listenable {
|
539
|
541
|
ping(timeout) {
|
540
|
542
|
return new Promise((resolve, reject) => {
|
541
|
543
|
this.connection.ping
|
542
|
|
- .ping(this.connection.domain, resolve, reject, timeout);
|
|
544
|
+ .ping(this.connection.options.hosts.domain, resolve, reject, timeout);
|
543
|
545
|
});
|
544
|
546
|
}
|
545
|
547
|
|