diff --git a/mozilla/extensions/irc/js/lib/irc.js b/mozilla/extensions/irc/js/lib/irc.js index eaaed3bf2ff..f6c45d6dc81 100644 --- a/mozilla/extensions/irc/js/lib/irc.js +++ b/mozilla/extensions/irc/js/lib/irc.js @@ -122,7 +122,6 @@ function net_geturl () CIRCNetwork.prototype.connect = function net_conenct() { - if ("primServ" in this && this.primServ.connection.isConnected) return; @@ -132,17 +131,13 @@ function net_conenct() this.nextHost = 0; var ev = new CEvent ("network", "do-connect", this, "onDoConnect"); this.eventPump.addEvent (ev); - } CIRCNetwork.prototype.quit = function net_quit (reason) { - - this.stayingPower = false; if (this.isConnected()) this.primServ.logout (reason); - } /* @@ -366,6 +361,8 @@ function serv_logout(reason) if (typeof reason == "undefined") reason = this.DEFAULT_REASON; + this.quitting = true; + this.connection.sendData ("QUIT :" + reason + "\n"); this.connection.disconnect(); @@ -547,7 +544,8 @@ function serv_disconnect(e) if (("connecting" in this.parent) || /* fell off while connecting, try again */ - (this.parent.primServ == this) && (this.parent.stayingPower)) + (this.parent.primServ == this) && + (!("quitting" in this) && this.parent.stayingPower)) { /* fell off primary server, reconnect to any host in the serverList */ var ev = new CEvent ("network", "do-connect", this.parent, "onDoConnect"); @@ -560,7 +558,9 @@ function serv_disconnect(e) for (var c in this.channels) this.channels[c].users = new Object(); - + + delete this.quitting; + return true; } @@ -692,9 +692,8 @@ function serv_ppline(e) * connection.....CBSConnection (this.connection) * source.........the of the message (if it exists) * user...........user object initialized with data from the message - * params.........array containing the parameters of the message - * code...........the first parameter (most messages have this) - * meat...........the parameter of the message + * params.........array containing the parameters of the message + * code...........the first parameter (most messages have this) * * See Section 2.3.1 of RFC 1459 for details on , and * tokens. @@ -736,14 +735,16 @@ function serv_onRawData(e) var sep = l.indexOf(" :"); if (sep != -1) /* param, if there is one */ - e.meat = l.substr (sep + 2, l.length); - else - e.meat = ""; - - if (sep != -1) + { + var trail = l.substr (sep + 2, l.length); e.params = l.substr(0, sep).split(" "); + e.params[e.params.length] = trail; + } else + { e.params = l.split(" "); + } + e.code = e.params[0].toUpperCase(); e.type = "parseddata"; @@ -799,7 +800,7 @@ function serv_topic (e) e.channel = new CIRCChannel (this, e.params[1]); e.channel.topicBy = e.user.nick; e.channel.topicDate = new Date(); - e.channel.topic = e.meat; + e.channel.topic = e.params[2]; e.destObject = e.channel; e.set = "channel"; @@ -843,7 +844,7 @@ function serv_332 (e) { e.channel = new CIRCChannel (this, e.params[2]); - e.channel.topic = e.meat; + e.channel.topic = e.params[3]; e.destObject = e.channel; e.set = "channel"; @@ -936,7 +937,7 @@ function serv_353 (e) e.destObject = e.channel; e.set = "channel"; - var nicks = e.meat.split (" "); + var nicks = e.params[4].split (" "); for (var n in nicks) { @@ -1224,9 +1225,7 @@ function serv_chanmode (e) CIRCServer.prototype.onNick = function serv_nick (e) { - /* Some irc networks send the new nick in the meat, some send it in param[1] - * Handle both cases. */ - var newNick = (e.meat) ? e.meat : e.params[1]; + var newNick = e.params[1]; var newKey = newNick.toLowerCase(); var oldKey = e.user.nick; var ev; @@ -1283,16 +1282,16 @@ function serv_quit (e) ev.user = e.server.channels[c].users[e.user.nick]; ev.channel = e.server.channels[c]; ev.server = ev.channel.parent; - ev.reason = e.meat; + ev.reason = e.params[1]; this.parent.eventPump.addEvent(ev); delete e.server.channels[c].users[e.user.nick]; } } - this.users[e.user.nick].lastQuitMessage = e.meat; + this.users[e.user.nick].lastQuitMessage = e.params[1]; this.users[e.user.nick].lastQuitDate = new Date; - e.reason = e.meat; + e.reason = e.params[1]; e.destObject = e.user; e.set = "user"; @@ -1325,7 +1324,7 @@ function serv_kick (e) delete e.channel.users[e.lamer.nick]; if (userIsMe(e.lamer)) e.channel.active = false; - e.reason = e.meat; + e.reason = e.params[3]; e.destObject = e.channel; e.set = "channel"; @@ -1337,7 +1336,7 @@ CIRCServer.prototype.onJoin = function serv_join (e) { - e.channel = new CIRCChannel (this, (e.meat ? e.meat : e.params[1])); + e.channel = new CIRCChannel (this, e.params[1]); if (e.user == this.me) e.server.sendData ("MODE " + e.channel.encodedName + "\n" /* + "BANS " + e.channel.encodedName + "\n" */); @@ -1357,14 +1356,7 @@ function serv_ping (e) { /* non-queued send, so we can calcualte lag */ - if (e.meat) - { - this.connection.sendData ("PONG :" + e.meat + "\n"); - } - else - { - this.connection.sendData ("PONG :" + e.params[e.params.length - 1] + "\n"); - } + this.connection.sendData ("PONG :" + e.params[1] + "\n"); this.connection.sendData ("PING :LAGTIMER\n"); this.lastPing = this.lastPingSent = new Date(); @@ -1378,7 +1370,7 @@ function serv_ping (e) CIRCServer.prototype.onPong = function serv_pong (e) { - if (e.meat != "LAGTIMER") + if (e.params[2] != "LAGTIMER") return true; if (this.lastPingSent) @@ -1412,7 +1404,7 @@ function serv_notice (e) e.replyTo = e.channel; e.set = "channel"; } - else if (e.meat.search (/\x01.*\x01/i) != -1) + else if (e.params[2].search (/\x01.*\x01/i) != -1) { e.type = "ctcp-reply"; e.destMethod = "onCTCPReply"; @@ -1452,7 +1444,7 @@ function serv_privmsg (e) e.replyTo = e.user; /* send replys to the user who sent the message */ } - if (e.meat.search (/\x01.*\x01/i) != -1) + if (e.params[2].search (/\x01.*\x01/i) != -1) { e.type = "ctcp"; e.destMethod = "onCTCP"; @@ -1469,7 +1461,7 @@ function serv_privmsg (e) CIRCServer.prototype.onCTCPReply = function serv_ctcpr (e) { - var ary = e.meat.match (/^\x01(\S+) ?(.*)\x01$/i); + var ary = e.params[2].match (/^\x01(\S+) ?(.*)\x01$/i); if (ary == null) return false; @@ -1512,7 +1504,7 @@ function serv_ctcpr (e) CIRCServer.prototype.onCTCP = function serv_ctcp (e) { - var ary = e.meat.match (/^\x01(\S+) ?(.*)\x01$/i); + var ary = e.params[2].match (/^\x01(\S+) ?(.*)\x01$/i); if (ary == null) return false; diff --git a/mozilla/extensions/irc/xul/content/handlers.js b/mozilla/extensions/irc/xul/content/handlers.js index 9e9cdbd26ba..638d042b2c2 100644 --- a/mozilla/extensions/irc/xul/content/handlers.js +++ b/mozilla/extensions/irc/xul/content/handlers.js @@ -763,11 +763,11 @@ function onInputKeyPress (e) switch (e.keyCode) { case 13: /* CR */ - e.line = stringTrim(e.target.value); - if (!e.line) + e.line = e.target.value; + e.target.value = ""; + if (e.line.search(/\S/) == -1) return; onInputCompleteLine (e); - e.target.value = ""; break; case 38: /* up */ @@ -1352,7 +1352,7 @@ function cli_testdisplay (e) client.currentObject.display (getMsg("cli_testdisplayMsg5"), "USAGE"); client.currentObject.display (getMsg("cli_testdisplayMsg6"), "STATUS"); - if (o.server && o.server.me) + if ("server" in o && o.server.me) { var me = o.server.me; var viewType = client.currentObject.TYPE; @@ -1394,6 +1394,8 @@ function cli_testdisplay (e) "PRIVMSG", sampleUser, me); client.currentObject.display (unescape(getMsg("cli_testdisplayMsg21")), "PRIVMSG", sampleUser, me); + client.currentObject.display (unescape(getMsg("cli_testdisplayMsg22")), + "PRIVMSG", sampleUser, me); if (viewType == "IRCChannel") @@ -2609,11 +2611,14 @@ function my_unknown (e) e.params.shift(); /* and the dest. nick (always me) */ /* if it looks like some kind of "end of foo" code, and we don't * already have a mapping for it, make one up */ - if (!(e.code in client.responseCodeMap) && e.meat.search (/^end of/i) != -1) + var length = e.params.length; + if (!(e.code in client.responseCodeMap) && + (e.params[length - 1].search (/^end of/i) != -1)) + { client.responseCodeMap[e.code] = "---"; + } - this.display (e.params.join(" ") + ": " + e.meat, - e.code.toUpperCase()); + this.display (e.params.join(" "), e.code.toUpperCase()); } CIRCNetwork.prototype.on001 = /* Welcome! */ @@ -2633,7 +2638,7 @@ CIRCNetwork.prototype.on372 = /* MOTD line */ CIRCNetwork.prototype.on376 = /* end of MOTD */ function my_showtonet (e) { - var p = (2 in e.params) ? e.params[2] + " " : ""; + var p = (3 in e.params) ? e.params[2] + " " : ""; var str = ""; switch (e.code) @@ -2661,7 +2666,16 @@ function my_showtonet (e) } delete this.pendingURLs; } - str = e.meat; + for (var v in client.viewsArray) + { + // reconnect to any existing views + var source = client.viewsArray[v].source; + var details = getObjectDetails(client.viewsArray[v].source); + if ("network" in details && details.network == this) + gotoIRCURL(source.getURL()); + } + + str = e.params[2]; break; case "372": @@ -2672,7 +2686,8 @@ function my_showtonet (e) /* no break */ default: - str = e.meat; + var length = e.params.length; + str = e.params[length - 1]; break; } @@ -2691,13 +2706,13 @@ function my_ctcprunk (e) CIRCNetwork.prototype.onNotice = function my_notice (e) { - this.display (e.meat, "NOTICE", this, e.server.me); + this.display (e.params[2], "NOTICE", this, e.server.me); } CIRCNetwork.prototype.on303 = /* ISON (aka notify) reply */ function my_303 (e) { - var onList = stringTrim(e.meat.toLowerCase()).split(/\s+/); + var onList = stringTrim(e.params[1].toLowerCase()).split(/\s+/); var offList = new Array(); var newArrivals = new Array(); var newDepartures = new Array(); @@ -2792,8 +2807,8 @@ function my_321 (e) { if (list.event323) { - network.displayHere (list.event323.params.join(" ") + ": " + - list.event323.meat, "323"); + var length = list.event323.params.length; + network.displayHere (list.event323.params[length - 1], "323"); } network.displayHere (getMsg("my_323", [list.displayed, list.count]), "INFO"); @@ -2810,7 +2825,7 @@ function my_321 (e) this.list = new Array(); this.list.regexp = null; } - this.displayHere (e.params[2] + " " + e.meat, "321"); + this.displayHere (e.params[2] + " " + e.params[3], "321"); if (client.currentObject != this) client.currentObject.display (getMsg("my_321", this.name), "INFO"); this.list.lastLength = 0; @@ -2839,9 +2854,9 @@ function my_listrply (e) ++this.list.count; e.params[2] = toUnicode(e.params[2]); if (!(this.list.regexp) || e.params[2].match(this.list.regexp) - || e.meat.match(this.list.regexp)) + || e.params[4].match(this.list.regexp)) { - this.list.push([e.params[2], e.params[3], e.meat]); + this.list.push([e.params[2], e.params[3], e.params[4]]); } } @@ -2865,7 +2880,8 @@ function my_352 (e) //5-irc.mozilla.org 6-rginda 7-H var desc; var hops = "?"; - var ary = e.meat.match(/(\d+)\s(.*)/); + var length = e.params.length; + var ary = e.params[length - 1].match(/(\d+)\s(.*)/); if (ary) { hops = Number(ary[1]); @@ -2873,7 +2889,7 @@ function my_352 (e) } else { - desc = e.meat; + desc = e.params[length - 1]; } var status = e.params[7]; @@ -2906,17 +2922,17 @@ function my_whoisreply (e) { case 311: text = getMsg("my_whoisreplyMsg", - [nick, e.params[3], e.params[4], e.meat]); + [nick, e.params[3], e.params[4], e.params[6]]); break; case 319: - var ary = stringTrim(e.meat).split(" "); + var ary = stringTrim(e.params[3]).split(" "); text = getMsg("my_whoisreplyMsg2",[nick, arraySpeak(ary)]); break; case 312: text = getMsg("my_whoisreplyMsg3", - [nick, e.params[3], e.meat]); + [nick, e.params[3], e.params[4]]); break; case 317: @@ -2953,7 +2969,7 @@ CIRCNetwork.prototype.onInvite = /* invite message */ function my_invite (e) { this.display (getMsg("my_Invite", [e.user.properNick, e.user.name, - e.user.host, e.meat]), "INVITE"); + e.user.host, e.params[2]]), "INVITE"); } CIRCNetwork.prototype.on433 = /* nickname in use */ @@ -3000,7 +3016,7 @@ function my_neterror (e) } } else - msg = e.meat; + msg = e.params[e.params.length - 1]; this.display (msg, "ERROR"); } @@ -3011,6 +3027,7 @@ function my_netdisconnect (e) { var connection = e.server.connection; var msg; + var reconnect = false; if (typeof e.disconnectStatus != "undefined") { @@ -3039,6 +3056,7 @@ function my_netdisconnect (e) default: msg = getMsg("my_netdisconnectConnectionClosedStatus", [this.name, connection.host, connection.port]); + reconnect = true; break; } } @@ -3119,15 +3137,15 @@ CIRCChannel.prototype.onPrivmsg = function my_cprivmsg (e) { - this.display (e.meat, "PRIVMSG", e.user, this); + this.display (e.params[2], "PRIVMSG", e.user, this); if ((typeof client.prefix == "string") && - e.meat.indexOf (client.prefix) == 0) + e.params[2].indexOf (client.prefix) == 0) { try { - var v = eval(e.meat.substring (client.prefix.length, - e.meat.length)); + var v = eval(e.params[2].substring (client.prefix.length, + e.params[2].length)); } catch (ex) { @@ -3180,7 +3198,7 @@ function my_366 (e) if ("pendingNamesReply" in e.channel) { - display (e.meat, "366"); + display (e.params[3], "366"); e.channel.pendingNamesReply = false; } } @@ -3221,14 +3239,14 @@ CIRCChannel.prototype.on353 = /* names reply */ function my_topic (e) { if ("pendingNamesReply" in e.channel) - e.channel.display (e.meat, "NAMES"); + e.channel.display (e.params[4], "NAMES"); } CIRCChannel.prototype.onNotice = function my_notice (e) { - this.display (e.meat, "NOTICE", e.user, this); + this.display (e.params[2], "NOTICE", e.user, this); } CIRCChannel.prototype.onCTCPAction = @@ -3414,7 +3432,7 @@ function my_cprivmsg (e) setCurrentObject(tab); } } - this.display (e.meat, "PRIVMSG", e.user, e.server.me); + this.display (e.params[2], "PRIVMSG", e.user, e.server.me); } CIRCUser.prototype.onNick = @@ -3432,7 +3450,7 @@ function my_unick (e) CIRCUser.prototype.onNotice = function my_notice (e) { - this.display (e.meat, "NOTICE", this, e.server.me); + this.display (e.params[2], "NOTICE", this, e.server.me); } CIRCUser.prototype.onCTCPAction = diff --git a/mozilla/extensions/irc/xul/content/prefpanel/appearance-previewCSS.html b/mozilla/extensions/irc/xul/content/prefpanel/appearance-previewCSS.html index c2ef1d37b3b..933cd1bd8db 100644 --- a/mozilla/extensions/irc/xul/content/prefpanel/appearance-previewCSS.html +++ b/mozilla/extensions/irc/xul/content/prefpanel/appearance-previewCSS.html @@ -22,14 +22,13 @@ ===*** Your host is irc.mozilla.org[irc.mozilla.org/6667], running version 2.8/hybrid-6.0 ===: Highest connection count: 417 (417 clients) (269041 since server was (re)started) -->|YOU have joined #mozilla - =-=Topic for #mozilla is ``<pinkerton> f**k me'' + =-=Topic for #mozilla is ``<pinkerton> something crude'' =-=Topic for #mozilla was set by dmose on Thu Jul 12 12:03:59 GMT-0700 (PDT) 2001 -->|illsleydc (illsleydc@usr2574-kno.cableinet.co.uk) has joined #mozilla -->|fantasai (fantasai@escape.com) has joined #mozilla -->|walk84_ (walk84@tc0-193.stn.bluemarble.net) has joined #mozilla fantasaiHixie: ping =-=akk is now known as akkPit - BenGoodgerdoes the matrix include a hot baby? pinkertonnotices the tipic pinkertoner, topic pinkertonhey ben @@ -70,7 +69,7 @@ =-=Sample Kick message |<--Sample Quit message IRCMonkeyrgindafoo : Sample /stalk match. - rgindaFOOSample text styles *bold*, _underline_, /italic/, |teletype|, #SmallCap# message. + rgindaFOOSample text styles *bold*, _underline_, /italic/, |teletype|, message. diff --git a/mozilla/extensions/irc/xul/content/prefpanel/pref-irc.xul b/mozilla/extensions/irc/xul/content/prefpanel/pref-irc.xul index 9f695b5881c..7f28f8f2805 100644 --- a/mozilla/extensions/irc/xul/content/prefpanel/pref-irc.xul +++ b/mozilla/extensions/irc/xul/content/prefpanel/pref-irc.xul @@ -42,7 +42,7 @@ @@ -73,7 +73,8 @@ -