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

This commit is contained in:
George Politis 2014-12-03 12:36:52 +01:00
parent 63dd6df217
commit 5af92474c3
2 changed files with 16 additions and 2 deletions

1
app.js
View File

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

View File

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