소스 검색

ref(ChatRoom): sendPresence only if connected

master
paweldomas 5 년 전
부모
커밋
f3adaa21b5
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4
    7
      modules/xmpp/ChatRoom.js

+ 4
- 7
modules/xmpp/ChatRoom.js 파일 보기

@@ -196,7 +196,7 @@ export default class ChatRoom extends Listenable {
196 196
     sendPresence(fromJoin) {
197 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 200
             // Too early to send presence - not initialized
201 201
             return;
202 202
         }
@@ -1273,9 +1273,9 @@ export default class ChatRoom extends Listenable {
1273 1273
      */
1274 1274
     sendAudioInfoPresence(mute, callback) {
1275 1275
         this.addAudioInfoToPresence(mute);
1276
-        if (this.connection) {
1277
-            this.sendPresence();
1278
-        }
1276
+
1277
+        // FIXME resend presence on CONNECTED
1278
+        this.sendPresence();
1279 1279
         if (callback) {
1280 1280
             callback();
1281 1281
         }
@@ -1301,9 +1301,6 @@ export default class ChatRoom extends Listenable {
1301 1301
      */
1302 1302
     sendVideoInfoPresence(mute) {
1303 1303
         this.addVideoInfoToPresence(mute);
1304
-        if (!this.connection) {
1305
-            return;
1306
-        }
1307 1304
         this.sendPresence();
1308 1305
     }
1309 1306
 

Loading…
취소
저장