]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/baseuiwindow.js
Improve nicklist performance.
[irc/quakenet/qwebirc.git] / js / ui / baseuiwindow.js
index 82c5af7bf6fee015d940f603469409d3c9b71f4b..ded43fda2bda65df0e0cfb0bdb05a178af9285cf 100644 (file)
@@ -16,6 +16,7 @@ qwebirc.ui.Window = new Class({
     this.scrolltimer = null;
     this.commandhistory = this.parentObject.commandhistory;
     this.scrolleddown = true;
+    this.lastNickHash = {};
     //new CommandHistory();
   },
   updateNickList: function(nicks) {
@@ -124,6 +125,32 @@ qwebirc.ui.Window = new Class({
       this.scrolltimer = null;
     }
   },
+  updateNickList: function(nicks) {
+    var nickHash = {};
+    var added = [];
+    var lnh = this.lastNickHash;
+    
+    for(var i=0;i<nicks.length;i++) {
+      var n = nicks[i];
+      var l = lnh[n];
+      if(!l) {
+        l = this.nickListAdd(n, i);
+        if(!l)
+          l = 1;
+      }
+      nickHash[n] = l;
+    }
+    
+    for(var k in lnh)
+      if(!nickHash[k])
+        this.nickListRemove(k, lnh[k]);
+        
+    this.lastNickHash = nickHash;
+  },
+  nickListAdd: function(position, nick) {
+  },
+  nickListRemove: function(nick, stored) {
+  },
   historyExec: function(line) {
     this.commandhistory.addLine(line);
     this.client.exec(line);