Fixes issue with not removed ssrcs after the participant left the room.

This commit is contained in:
hristoterezov 2015-05-27 11:47:06 +03:00
parent 1d660e1883
commit 835e199135
4 changed files with 25 additions and 5 deletions

View File

@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=74"></script>
<script src="libs/app.bundle.js?v=75"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1">

View File

@ -12457,9 +12457,10 @@ StatsCollector.prototype.processAudioLevelReport = function ()
var ssrc = getStatValue(now, 'ssrc');
var jid = APP.xmpp.getJidFromSSRC(ssrc);
if (!jid && (Date.now() - now.timestamp) < 3000)
if (!jid)
{
console.warn("No jid for ssrc: " + ssrc);
if((Date.now() - now.timestamp) < 3000)
console.warn("No jid for ssrc: " + ssrc);
continue;
}
@ -16486,6 +16487,15 @@ module.exports = function(XMPP, eventEmitter) {
eventEmitter.emit(XMPPEvents.MUC_DESTROYED, reason);
return true;
}
var self = this;
// Remove old ssrcs coming from the jid
Object.keys(this.ssrc2jid).forEach(function (ssrc) {
if (self.ssrc2jid[ssrc] == from) {
delete self.ssrc2jid[ssrc];
}
});
// Status code 110 indicates that this notification is "self-presence".
if (!$(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length) {
delete this.members[from];

View File

@ -696,9 +696,10 @@ StatsCollector.prototype.processAudioLevelReport = function ()
var ssrc = getStatValue(now, 'ssrc');
var jid = APP.xmpp.getJidFromSSRC(ssrc);
if (!jid && (Date.now() - now.timestamp) < 3000)
if (!jid)
{
console.warn("No jid for ssrc: " + ssrc);
if((Date.now() - now.timestamp) < 3000)
console.warn("No jid for ssrc: " + ssrc);
continue;
}

View File

@ -278,6 +278,15 @@ module.exports = function(XMPP, eventEmitter) {
eventEmitter.emit(XMPPEvents.MUC_DESTROYED, reason);
return true;
}
var self = this;
// Remove old ssrcs coming from the jid
Object.keys(this.ssrc2jid).forEach(function (ssrc) {
if (self.ssrc2jid[ssrc] == from) {
delete self.ssrc2jid[ssrc];
}
});
// Status code 110 indicates that this notification is "self-presence".
if (!$(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length) {
delete this.members[from];