瀏覽代碼

Attempts to prevent ghost contacts from appearing in the contact list.

j8
George Politis 11 年之前
父節點
當前提交
5af92474c3
共有 2 個文件被更改,包括 16 次插入2 次删除
  1. 1
    0
      app.js
  2. 15
    2
      videolayout.js

+ 1
- 0
app.js 查看文件

@@ -824,6 +824,7 @@ $(document).bind('left.muc', function (event, jid) {
824 824
         var container = document.getElementById(
825 825
                 'participant_' + Strophe.getResourceFromJid(jid));
826 826
         if (container) {
827
+            ContactList.removeContact(jid);
827 828
             VideoLayout.removeConnectionIndicator(jid);
828 829
             // hide here, wait for video to close before removing
829 830
             $(container).hide();

+ 15
- 2
videolayout.js 查看文件

@@ -535,8 +535,21 @@ var VideoLayout = (function (my) {
535 535
                 VideoLayout.removeRemoteStreamElement(
536 536
                     stream, isVideo, container);
537 537
 
538
-                if (peerJid)
539
-                    ContactList.removeContact(peerJid);
538
+                // NOTE(gp) it seems that under certain circumstances, the
539
+                // onended event is not fired and thus the contact list is not
540
+                // updated.
541
+                //
542
+                // The onended event of a stream should be fired when the SSRCs
543
+                // corresponding to that stream are removed from the SDP; but
544
+                // this doesn't seem to always be the case, resulting in ghost
545
+                // contacts.
546
+                //
547
+                // In an attempt to fix the ghost contacts problem, I'm moving
548
+                // the removeContact() method call in app.js, inside the
549
+                // 'muc.left' event handler.
550
+
551
+                //if (peerJid)
552
+                //    ContactList.removeContact(peerJid);
540 553
             };
541 554
 
542 555
             // Add click handler.

Loading…
取消
儲存