Browse Source

fix(XMPP): Get the correct domain for XMPP ping.

dev1
Jaya Allamsetty 5 years ago
parent
commit
036daacade
2 changed files with 8 additions and 2 deletions
  1. 7
    0
      modules/xmpp/XmppConnection.js
  2. 1
    2
      modules/xmpp/xmpp.js

+ 7
- 0
modules/xmpp/XmppConnection.js View File

@@ -175,6 +175,13 @@ export default class XmppConnection extends Listenable {
175 175
         return this._stropheConn.options;
176 176
     }
177 177
 
178
+    /**
179
+     * A getter for the domain to be used for ping.
180
+     */
181
+    get pingDomain() {
182
+        return this._options.pingOptions?.domain || this.domain;
183
+    }
184
+
178 185
     /**
179 186
      * A getter for the service URL.
180 187
      *

+ 1
- 2
modules/xmpp/xmpp.js View File

@@ -540,8 +540,7 @@ export default class XMPP extends Listenable {
540 540
      */
541 541
     ping(timeout) {
542 542
         return new Promise((resolve, reject) => {
543
-            this.connection.ping
544
-                    .ping(this.connection.options.hosts.domain, resolve, reject, timeout);
543
+            this.connection.ping.ping(this.connection.pingDomain, resolve, reject, timeout);
545 544
         });
546 545
     }
547 546
 

Loading…
Cancel
Save