diff --git a/js/lib/irc.js b/js/lib/irc.js --- a/js/lib/irc.js +++ b/js/lib/irc.js @@ -1334,8 +1334,8 @@ e.decodeParam = decodeParam; e.code = e.params[0].toUpperCase(); - // Ignore all Privmsg and Notice messages here. - if (e.ignored && ((e.code == "PRIVMSG") || (e.code == "NOTICE"))) + // Ignore all private (inc. channel) messages, notices and invites here. + if (e.ignored && ((e.code == "PRIVMSG") || (e.code == "NOTICE") || (e.code == "INVITE") )) return true; e.type = "parseddata"; @@ -2751,6 +2751,8 @@ e.id = ary[2]; // Cheeky longword --> dotted IP conversion. var host = Number(e.id).toString(16); + while (host.length < 8) + host = '0' + host; e.host = Number("0x" + host.substr(0, 2)) + "." + Number("0x" + host.substr(2, 2)) + "." + Number("0x" + host.substr(4, 2)) + "." + diff --git a/xul/content/commands.js b/xul/content/commands.js --- a/xul/content/commands.js +++ b/xul/content/commands.js @@ -102,7 +102,7 @@ ["kick", cmdKick, CMD_NEED_CHAN | CMD_CONSOLE], ["kick-ban", cmdKick, CMD_NEED_CHAN | CMD_CONSOLE], ["knock", cmdKnock, CMD_NEED_SRV | CMD_CONSOLE], - ["leave", cmdLeave, CMD_NEED_SRV | CMD_CONSOLE], + ["leave", cmdLeave, CMD_NEED_NET | CMD_CONSOLE], ["links", cmdSimpleCommand, CMD_NEED_SRV | CMD_CONSOLE], ["list", cmdList, CMD_NEED_SRV | CMD_CONSOLE], ["list-plugins", cmdListPlugins, CMD_CONSOLE], @@ -2385,7 +2385,7 @@ { if (!e.server) { - display(MSG_ERR_IMPROPER_VIEW, MT_ERROR); + display(getMsg(MSG_ERR_IMPROPER_VIEW, e.command.name), MT_ERROR); return; } diff --git a/xul/content/static.js b/xul/content/static.js --- a/xul/content/static.js +++ b/xul/content/static.js @@ -2008,29 +2008,18 @@ { /* url points to a channel */ var key; - if (url.needkey) - { - if (url.key) - key = url.key; - else - key = window.promptPassword(getMsg(MSG_URL_KEY, url.spec)); - } - + var serv = network.primServ; + var target = url.target; if (url.charset) { - client.pendingViewContext = e; - var d = { channelName: url.target, key: key, - charset: url.charset }; - targetObject = network.dispatch("join", d); - delete client.pendingViewContext; + var chan = new CIRCChannel(serv, target, fromUnicode(target, url.charset)); + chan.prefs["charset"] = url.charset; } else { // Must do this the hard way... we have the server's format // for the channel name here, and all our commands only work // with the Unicode forms. - var serv = network.primServ; - var target = url.target; /* If we don't have a valid prefix, stick a "#" on it. * NOTE: This is always a "#" so that URLs may be compared @@ -2043,13 +2032,20 @@ } var chan = new CIRCChannel(serv, null, target); - - client.pendingViewContext = e; - d = {channelToJoin: chan, key: key}; - targetObject = network.dispatch("join", d); - delete client.pendingViewContext; } + if (url.needkey && !chan.joined) + { + if (url.key) + key = url.key; + else + key = window.promptPassword(getMsg(MSG_URL_KEY, url.spec)); + } + client.pendingViewContext = e; + d = {channelToJoin: chan, key: key}; + targetObject = network.dispatch("join", d); + delete client.pendingViewContext; + if (!targetObject) return; }