Sfoglia il codice sorgente

Fixes a bug added in 0f40e2efd4.

master
Boris Grozev 9 anni fa
parent
commit
8c3f7084b7
1 ha cambiato i file con 3 aggiunte e 6 eliminazioni
  1. 3
    6
      modules/xmpp/ChatRoom.js

+ 3
- 6
modules/xmpp/ChatRoom.js Vedi File

@@ -577,15 +577,12 @@ ChatRoom.prototype.addToPresence = function (key, values) {
577 577
     values.tagName = key;
578 578
     this.removeFromPresence(key);
579 579
     this.presMap.nodes.push(values);
580
-    this.presMap["nodes"].push(values);
581 580
 };
582 581
 
583 582
 ChatRoom.prototype.removeFromPresence = function (key) {
584
-    for(var i = 0; i < this.presMap.nodes.length; i++)
585
-    {
586
-        if(key === this.presMap.nodes[i].tagName)
587
-            this.presMap.nodes.splice(i, 1);
588
-    }
583
+    var nodes = this.presMap.nodes.filter(function(node) {
584
+        return key !== node.tagName;});
585
+    this.presMap.nodes = nodes;
589 586
 };
590 587
 
591 588
 ChatRoom.prototype.addPresenceListener = function (name, handler) {

Loading…
Annulla
Salva