X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/8411f8a7a07c243cdb5f3f6664608fb38d95be5b..fb28e394a2670944ee36f7c386cbc884d9207daa:/js/ui/baseuiwindow.js diff --git a/js/ui/baseuiwindow.js b/js/ui/baseuiwindow.js index 6179b35..1466907 100644 --- a/js/ui/baseuiwindow.js +++ b/js/ui/baseuiwindow.js @@ -21,7 +21,7 @@ qwebirc.ui.Window = new Class({ 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; @@ -98,8 +98,10 @@ qwebirc.ui.Window = new Class({ 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)$/)) { @@ -108,15 +110,13 @@ qwebirc.ui.Window = new Class({ 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; } @@ -204,26 +204,27 @@ qwebirc.ui.Window = new Class({ } }, updateNickList: function(nicks) { - var nickHash = {}, present = {}; + var nickHash = new QHash(), present = new QSet(); var added = []; var lnh = this.lastNickHash; for(var i=0;i