소스 검색

Handles unique Id for a meeting.

dev1
damencho 5 년 전
부모
커밋
24a05989dd
2개의 변경된 파일39개의 추가작업 그리고 0개의 파일을 삭제
  1. 11
    0
      JitsiConference.js
  2. 28
    0
      modules/xmpp/ChatRoom.js

+ 11
- 0
JitsiConference.js 파일 보기

2122
     return null;
2122
     return null;
2123
 };
2123
 };
2124
 
2124
 
2125
+/**
2126
+ * Returns the meeting unique Id if any.
2127
+ */
2128
+JitsiConference.prototype.getMeetingUniqueId = function() {
2129
+    if (this.room) {
2130
+        return this.room.getMeetingId();
2131
+    }
2132
+
2133
+    return null;
2134
+};
2135
+
2125
 /**
2136
 /**
2126
  * Will return P2P or JVB <tt>TraceablePeerConnection</tt> depending on
2137
  * Will return P2P or JVB <tt>TraceablePeerConnection</tt> depending on
2127
  * which connection is currently active.
2138
  * which connection is currently active.

+ 28
- 0
modules/xmpp/ChatRoom.js 파일 보기

127
 
127
 
128
         this.locked = false;
128
         this.locked = false;
129
         this.transcriptionStatus = JitsiTranscriptionStatus.OFF;
129
         this.transcriptionStatus = JitsiTranscriptionStatus.OFF;
130
+        this.meetingId = null;
130
     }
131
     }
131
 
132
 
132
     /* eslint-enable max-params */
133
     /* eslint-enable max-params */
277
                 this.eventEmitter.emit(XMPPEvents.MUC_LOCK_CHANGED, locked);
278
                 this.eventEmitter.emit(XMPPEvents.MUC_LOCK_CHANGED, locked);
278
                 this.locked = locked;
279
                 this.locked = locked;
279
             }
280
             }
281
+
282
+            const meetingIdValEl
283
+                = $(result).find('>query>x[type="result"]>field[var="muc#roominfo_meetingId"]>value');
284
+
285
+            if (meetingIdValEl.length) {
286
+                const meetingId = meetingIdValEl.text();
287
+
288
+                if (this.meetingId !== meetingId) {
289
+                    if (this.meetingId) {
290
+                        logger.warn(`Meeting Id changed from:${this.meetingId} to:${meetingId}`);
291
+                    }
292
+                    this.meetingId = meetingId;
293
+                }
294
+            } else {
295
+                logger.trace('No meeting id from backend');
296
+            }
280
         }, error => {
297
         }, error => {
281
             GlobalOnErrorHandler.callErrorHandler(error);
298
             GlobalOnErrorHandler.callErrorHandler(error);
282
             logger.error('Error getting room info: ', error);
299
             logger.error('Error getting room info: ', error);
478
                 this.sendPresence();
495
                 this.sendPresence();
479
 
496
 
480
                 this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
497
                 this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
498
+
499
+                // Now let's check the disco-info to retrieve the
500
+                // meeting Id if any
501
+                this.discoRoomInfo();
481
             }
502
             }
482
         } else if (jid === undefined) {
503
         } else if (jid === undefined) {
483
             logger.info('Ignoring member with undefined JID');
504
             logger.info('Ignoring member with undefined JID');
1363
         return this.phonePin;
1384
         return this.phonePin;
1364
     }
1385
     }
1365
 
1386
 
1387
+    /**
1388
+     * Returns the meeting unique Id if any came from backend.
1389
+     */
1390
+    getMeetingId() {
1391
+        return this.meetingId;
1392
+    }
1393
+
1366
     /**
1394
     /**
1367
      * Mutes remote participant.
1395
      * Mutes remote participant.
1368
      * @param jid of the participant
1396
      * @param jid of the participant

Loading…
취소
저장