this.commandhistory = this.parentObject.commandhistory;
this.scrolleddown = true;
this.scrollpos = null;
- this.lastNickHash = {};
+ this.lastNickHash = new QHash();
this.lastSelected = null;
this.subWindow = null;
this.closed = false;
addLine: function(type, line, colour, element) {
var hilight = qwebirc.ui.HILIGHT_NONE;
var lhilight = false;
-
+
if(type) {
+ var selectMe = function() { this.parentObject.selectWindow(this); }.bind(this);
+ var message = $defined(line) ? line["m"] : null;
hilight = qwebirc.ui.HILIGHT_ACTIVITY;
if(type.match(/(NOTICE|ACTION|MSG)$/)) {
hilight = qwebirc.ui.HILIGHT_ACTIVITY;
} else {
hilight = qwebirc.ui.HILIGHT_US;
- this.parentObject.beep();
- this.parentObject.flash();
+ this.parentObject.notify("Private message from " + this.name, message, selectMe);
}
}
- if(!type.match(/^OUR/) && this.client.hilightController.match(line["m"])) {
+ if(!type.match(/^OUR/) && this.client.hilightController.match(message)) {
lhilight = true;
hilight = qwebirc.ui.HILIGHT_US;
- this.parentObject.beep();
- this.parentObject.flash();
+ this.parentObject.notify("Hilighted in " + this.name, message, selectMe);
} else if(hilight != qwebirc.ui.HILIGHT_US) {
hilight = qwebirc.ui.HILIGHT_SPEECH;
}
}
},
updateNickList: function(nicks) {
- var nickHash = {}, present = {};
+ var nickHash = new QHash(), present = new QSet();
var added = [];
var lnh = this.lastNickHash;
for(var i=0;i<nicks.length;i++)
- present[nicks[i]] = 1;
-
- for(var k in lnh)
- if(!present[k])
- this.nickListRemove(k, lnh[k]);
-
+ present.add(nicks[i]);
+
+ lnh.each(function(k, v) {
+ if(!present.contains(k))
+ this.nickListRemove(k, v);
+ }, this);
+
for(var i=0;i<nicks.length;i++) {
var n = nicks[i];
- var l = lnh[n];
+ var l = lnh.get(n);
if(!l) {
l = this.nickListAdd(n, i);
if(!l)
l = 1;
}
- nickHash[n] = l;
+ nickHash.put(n, l);
}
this.lastNickHash = nickHash;