Browse Source

ref(ChatRoom): sendPresence only if connected

master
paweldomas 5 years ago
parent
commit
f3adaa21b5
1 changed files with 4 additions and 7 deletions
  1. 4
    7
      modules/xmpp/ChatRoom.js

+ 4
- 7
modules/xmpp/ChatRoom.js View File

196
     sendPresence(fromJoin) {
196
     sendPresence(fromJoin) {
197
         const to = this.presMap.to;
197
         const to = this.presMap.to;
198
 
198
 
199
-        if (!to || (!this.joined && !fromJoin)) {
199
+        if (!this.connection || !this.connection.connected || !to || (!this.joined && !fromJoin)) {
200
             // Too early to send presence - not initialized
200
             // Too early to send presence - not initialized
201
             return;
201
             return;
202
         }
202
         }
1273
      */
1273
      */
1274
     sendAudioInfoPresence(mute, callback) {
1274
     sendAudioInfoPresence(mute, callback) {
1275
         this.addAudioInfoToPresence(mute);
1275
         this.addAudioInfoToPresence(mute);
1276
-        if (this.connection) {
1277
-            this.sendPresence();
1278
-        }
1276
+
1277
+        // FIXME resend presence on CONNECTED
1278
+        this.sendPresence();
1279
         if (callback) {
1279
         if (callback) {
1280
             callback();
1280
             callback();
1281
         }
1281
         }
1301
      */
1301
      */
1302
     sendVideoInfoPresence(mute) {
1302
     sendVideoInfoPresence(mute) {
1303
         this.addVideoInfoToPresence(mute);
1303
         this.addVideoInfoToPresence(mute);
1304
-        if (!this.connection) {
1305
-            return;
1306
-        }
1307
         this.sendPresence();
1304
         this.sendPresence();
1308
     }
1305
     }
1309
 
1306
 

Loading…
Cancel
Save