X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/70b9d2aa13ce63e6ff0c4acd837c836fa7408771..015ab79ac65cca3c99282e6c735412131f92e4f9:/js/ui/baseuiwindow.js diff --git a/js/ui/baseuiwindow.js b/js/ui/baseuiwindow.js index 1466907..a31338f 100644 --- a/js/ui/baseuiwindow.js +++ b/js/ui/baseuiwindow.js @@ -33,7 +33,7 @@ qwebirc.ui.Window = new Class({ } }, updateTopic: function(topic, element) { - qwebirc.ui.Colourise("[" + topic + "]", element, this.client.exec, this.parentObject.urlDispatcher.bind(this.parentObject), this); + qwebirc.ui.Colourise(topic, element, this.client.exec, this.parentObject.urlDispatcher.bind(this.parentObject), this); }, close: function() { this.closed = true; @@ -100,26 +100,36 @@ qwebirc.ui.Window = new Class({ 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)$/)) { - if(this.type == qwebirc.ui.WINDOW_QUERY || this.type == qwebirc.ui.WINDOW_MESSAGES) { - if(type.match(/^OUR/) || type.match(/NOTICE$/)) { - hilight = qwebirc.ui.HILIGHT_ACTIVITY; + var message = $defined(line) ? line["m"] : null; + + /* https://dl.dropboxusercontent.com/u/180911/notify.png */ + if(type.match(/^OUR/)) { + if(type.match(/NOTICE$/)) { + /* default */ } else { - hilight = qwebirc.ui.HILIGHT_US; - this.parentObject.notify("Private message from " + this.name, message, selectMe); + hilight = qwebirc.ui.HILIGHT_SPEECH; } - } - if(!type.match(/^OUR/) && this.client.hilightController.match(message)) { + } else if(this.client.hilightController.match(message)) { + hilight = qwebirc.ui.HILIGHT_US; lhilight = true; + } else if(type.match(/NOTICE$/)) { + /* default */ + } else if(this.type == qwebirc.ui.WINDOW_QUERY || this.type == qwebirc.ui.WINDOW_MESSAGES) { hilight = qwebirc.ui.HILIGHT_US; - this.parentObject.notify("Hilighted in " + this.name, message, selectMe); - } else if(hilight != qwebirc.ui.HILIGHT_US) { + } else { hilight = qwebirc.ui.HILIGHT_SPEECH; } + + if(hilight == qwebirc.ui.HILIGHT_US) { + var title = this.parentObject.theme.message("NOTIFY" + type + "TITLE", line, false); + var body = this.parentObject.theme.message("NOTIFY" + type + "BODY", line, false); + var selectMe = function() { this.parentObject.selectWindow(this); }.bind(this); + + this.parentObject.notify(title, body, selectMe); + } } }