- addLine: function(type, line, colour, element, parent, scrollparent) {
- if(!this.active && !this.hilighted)
- this.setHilighted(true);
-
+ resetScrollPos: function() {
+ if(this.scrolleddown) {
+ this.scrollToBottom();
+ } else if($defined(this.scrollpos)) {
+ this.getScrollParent().scrollTo(this.scrollpos.x, this.scrollpos.y);
+ }
+ },
+ setScrollPos: function() {
+ if(!this.parentObject.singleWindow) {
+ this.scrolleddown = this.scrolledDown();
+ this.scrollpos = this.lines.getScroll();
+ }
+ },
+ 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)$/)) {
+ 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;
+ } else {
+ hilight = qwebirc.ui.HILIGHT_US;
+ this.parentObject.notify("Private message from " + this.name, message, selectMe);
+ }
+ }
+ if(!type.match(/^OUR/) && this.client.hilightController.match(message)) {
+ lhilight = true;
+ hilight = qwebirc.ui.HILIGHT_US;
+ this.parentObject.notify("Hilighted in " + this.name, message, selectMe);
+ } else if(hilight != qwebirc.ui.HILIGHT_US) {
+ hilight = qwebirc.ui.HILIGHT_SPEECH;
+ }
+ }
+ }
+
+ if(!this.active && (hilight != qwebirc.ui.HILIGHT_NONE))
+ this.setHilighted(hilight);
+