landing 0.9.40

fixes a number of i18n issues, and the following bugs:
http://bugzilla.mozilla.org/buglist.cgi?bug_id=221068,220839,217358,207182,213782


git-svn-id: svn://10.0.0.236/trunk@147864 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rginda%netscape.com 2003-10-11 00:21:05 +00:00
parent 88ae604058
commit 55c040b956
10 changed files with 248 additions and 118 deletions

View File

@ -184,6 +184,7 @@ function ep_routeevent (e)
e.level++;
this.onHook (e);
var destObject = e.destObject;
e.currentObject = destObject;
e.destObject = (void 0);
switch (typeof destObject[e.destMethod])

View File

@ -80,6 +80,19 @@ function userIsMe (user)
return false;
}
/*
* Attached to event objects in onRawData
*/
function decodeParam(number, charsetOrObject)
{
if (!charsetOrObject)
charsetOrObject = this.currentObject;
var rv = toUnicode(this.params[number], charsetOrObject);
return rv;
}
/*
* irc network
*/
@ -129,7 +142,7 @@ function net_geturl(target)
if (!target)
target = "";
return "irc://" + escape(this.name) + "/" + target;
return "irc://" + ecmaEscape(this.name) + "/" + target;
}
CIRCNetwork.prototype.getUser =
@ -163,7 +176,7 @@ CIRCNetwork.prototype.quit =
function net_quit (reason)
{
if (this.isConnected())
this.primServ.logout(fromUnicode(reason, this));
this.primServ.logout(reason);
}
/*
@ -397,7 +410,8 @@ function serv_login(nick, name, desc)
if (this.password)
this.sendData ("PASS " + this.password + "\n");
this.sendData ("NICK " + nick + "\n");
this.sendData ("USER " + name + " foo bar :" + desc + "\n");
this.sendData ("USER " + name + " foo bar :" +
fromUnicode(desc, this) + "\n");
}
CIRCServer.prototype.logout =
@ -425,7 +439,7 @@ function serv_addusr (nick, name, host)
{
return new CIRCUser(this, nick, name, host);
}
CIRCServer.prototype.getChannelsLength =
function serv_chanlen()
{
@ -513,7 +527,7 @@ function serv_messto (code, target, msg, ctcpCode)
else
line += sfx;
//dd ("-*- irc sending '" + line + "'");
this.sendData (line + "\n");
this.sendData(line + "\n");
}
}
@ -524,19 +538,19 @@ function serv_messto (code, target, msg, ctcpCode)
CIRCServer.prototype.sayTo =
function serv_sayto (target, msg)
{
this.messageTo ("PRIVMSG", target, msg);
this.messageTo("PRIVMSG", target, msg);
}
CIRCServer.prototype.noticeTo =
function serv_noticeto (target, msg)
{
this.messageTo ("NOTICE", target, msg);
this.messageTo("NOTICE", target, msg);
}
CIRCServer.prototype.actTo =
function serv_actto (target, msg)
{
this.messageTo ("PRIVMSG", target, msg, "ACTION");
this.messageTo("PRIVMSG", target, msg, "ACTION");
}
CIRCServer.prototype.ctcpTo =
@ -551,7 +565,7 @@ function serv_ctcpto (target, code, msg, method)
code = code.toUpperCase();
if (code == "PING" && !msg)
msg = Number(new Date());
this.messageTo (method, target, msg, code);
this.messageTo(method, target, msg, code);
}
CIRCServer.prototype.updateLagTimer =
@ -779,6 +793,7 @@ function serv_onRawData(e)
e.params = l.split(" ");
}
e.decodeParam = decodeParam;
e.code = e.params[0].toUpperCase();
e.type = "parseddata";
@ -827,7 +842,7 @@ function serv_onParsedData(e)
CIRCServer.prototype.onTopic =
function serv_topic (e)
{
e.channel = new CIRCChannel (this, e.params[1]);
e.channel = new CIRCChannel(this, e.params[1]);
e.channel.topicBy = e.user.properNick;
e.channel.topicDate = new Date();
e.channel.topic = toUnicode(e.params[2], e.channel);
@ -1305,8 +1320,8 @@ function serv_nick (e)
CIRCServer.prototype.onQuit =
function serv_quit (e)
{
e.params[1] = toUnicode(e.params[1], this.parent);
var reason = e.decodeParam(1);
for (var c in e.server.channels)
{
if (e.server.channels[c].active &&
@ -1317,16 +1332,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.params[1];
ev.reason = reason;
this.parent.eventPump.addEvent(ev);
delete e.server.channels[c].users[e.user.nick];
}
}
this.users[e.user.nick].lastQuitMessage = e.params[1];
this.users[e.user.nick].lastQuitDate = new Date;
this.users[e.user.nick].lastQuitMessage = reason;
this.users[e.user.nick].lastQuitDate = new Date();
e.reason = e.params[1];
e.reason = reason;
e.destObject = e.user;
e.set = "user";
@ -1355,7 +1370,7 @@ function serv_kick (e)
delete e.channel.users[e.lamer.nick];
if (userIsMe(e.lamer))
e.channel.active = false;
e.reason = e.params[3];
e.reason = e.decodeParam(3);
e.destObject = e.channel;
e.set = "channel";
@ -1457,13 +1472,11 @@ function serv_privmsg (e)
e.user = new CIRCChanUser(e.channel, e.user.nick);
e.replyTo = e.channel;
e.set = "channel";
e.params[2] = toUnicode(e.params[2], e.channel);
}
else
{
e.set = "user";
e.replyTo = e.user; /* send replys to the user who sent the message */
e.params[2] = toUnicode(e.params[2], e.user);
}
if (e.params[2].search (/\x01.*\x01/i) != -1)
@ -1713,9 +1726,9 @@ function chan_geturl ()
{
var target;
if (this.normalizedName[0] == "#")
target = escape(this.normalizedName.substr(1));
target = ecmaEscape(this.normalizedName.substr(1));
else
target = escape(this.normalizedName);
target = ecmaEscape(this.normalizedName);
return this.parent.parent.getURL(target);
}
@ -1777,25 +1790,26 @@ function chan_amop()
CIRCChannel.prototype.setTopic =
function chan_topic (str)
{
this.parent.sendData ("TOPIC " + this.encodedName + " :" + str + "\n");
this.parent.sendData ("TOPIC " + this.encodedName + " :" +
fromUnicode(str, this) + "\n");
}
CIRCChannel.prototype.say =
function chan_say (msg)
{
this.parent.sayTo (this.encodedName, msg);
this.parent.sayTo(this.encodedName, fromUnicode(msg, this));
}
CIRCChannel.prototype.act =
function chan_say (msg)
{
this.parent.actTo (this.encodedName, msg);
this.parent.actTo(this.encodedName, fromUnicode(msg, this));
}
CIRCChannel.prototype.notice =
function chan_notice (msg)
{
this.parent.noticeTo (this.encodedName, msg);
this.parent.noticeTo(this.encodedName, fromUnicode(msg, this));
}
CIRCChannel.prototype.ctcp =
@ -1808,7 +1822,7 @@ function chan_ctcpto (code, msg, type)
type = "PRIVMSG";
this.parent.messageTo (type, this.encodedName, msg, code);
this.parent.messageTo(type, this.encodedName, fromUnicode(msg, this), code);
}
CIRCChannel.prototype.join =
@ -1925,8 +1939,8 @@ function chanm_lock (k)
if (!this.parent.users[this.parent.parent.me.nick].isOp)
return false;
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " +k " +
k + "\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " +k " +
k + "\n");
return true;
}
@ -1936,8 +1950,8 @@ function chan_unlock (k)
if (!this.parent.users[this.parent.parent.me.nick].isOp)
return false;
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " -k " +
k + "\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " -k " +
k + "\n");
return true;
}
@ -1949,8 +1963,8 @@ function chan_moderate (f)
var modifier = (f) ? "+" : "-";
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
modifier + "m\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " " +
modifier + "m\n");
return true;
}
@ -1962,8 +1976,8 @@ function chan_pmessages (f)
var modifier = (f) ? "-" : "+";
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
modifier + "n\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " " +
modifier + "n\n");
return true;
}
@ -1975,8 +1989,8 @@ function chan_ptopic (f)
var modifier = (f) ? "-" : "+";
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
modifier + "t\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " " +
modifier + "t\n");
return true;
}
@ -1988,8 +2002,8 @@ function chan_invite (f)
var modifier = (f) ? "+" : "-";
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
modifier + "i\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " " +
modifier + "i\n");
return true;
}
@ -2001,8 +2015,8 @@ function chan_pvt (f)
var modifier = (f) ? "+" : "-";
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
modifier + "p\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " " +
modifier + "p\n");
return true;
}
@ -2014,8 +2028,8 @@ function chan_secret (f)
var modifier = (f) ? "+" : "-";
this.parent.parent.sendData ("MODE " + this.parent.encodedName + " " +
modifier + "s\n");
this.parent.parent.sendData("MODE " + this.parent.encodedName + " " +
modifier + "s\n");
return true;
}
@ -2085,19 +2099,19 @@ function usr_hostmask (pfx)
CIRCUser.prototype.say =
function usr_say (msg)
{
this.parent.sayTo (this.nick, msg);
this.parent.sayTo(this.nick, fromUnicode(msg, this));
}
CIRCUser.prototype.notice =
function usr_notice (msg)
{
this.parent.noticeTo (this.nick, msg);
this.parent.noticeTo(this.nick, fromUnicode(msg, this));
}
CIRCUser.prototype.act =
function usr_act (msg)
{
this.parent.actTo (this.nick, msg);
this.parent.actTo(this.nick, fromUnicode(msg, this));
}
CIRCUser.prototype.ctcp =
@ -2110,15 +2124,14 @@ function usr_ctcp (code, msg, type)
type = "PRIVMSG";
this.parent.messageTo (type, this.name, msg, code);
this.parent.messageTo(type, this.name, fromUnicode(msg, this), code);
}
CIRCUser.prototype.whois =
function usr_whois ()
{
this.parent.whois (this.nick);
}
this.parent.whois(this.nick);
}
/*
* channel user
@ -2161,7 +2174,7 @@ function CIRCChanUser (parent, nick, isOp, isVoice)
function cusr_geturl ()
{
return this.parent.parent.getURL(escape(this.nick)) + ",isnick";
return this.parent.parent.getURL(ecmaEscape(this.nick)) + ",isnick";
}
function cusr_setop (f)
@ -2202,7 +2215,7 @@ function cusr_kick (reason)
return false;
server.sendData("KICK " + this.parent.encodedName + " " + this.nick + " :" +
reason + "\n");
fromUnicode(reason, this) + "\n");
return true;
}
@ -2241,7 +2254,8 @@ function cusr_kban (reason)
var modifier = " -o+b " + this.nick + " " + this.getHostMask() + " ";
server.sendData("MODE " + this.parent.encodedName + modifier + "\n" +
"KICK " + this.parent.encodedName + " " + this.nick + " :" +
"KICK " + this.parent.encodedName + " " +
fromUnicode(this.nick, this) + " :" +
reason + "\n");
return true;

View File

@ -144,8 +144,8 @@ function mm_fromunicode(msg, charset)
{
if ("Finish" in this.ucConverter)
{
msg = this.ucConverter.ConvertFromUnicode(msg);
this.ucConverter.Finish();
msg = this.ucConverter.ConvertFromUnicode(msg) +
this.ucConverter.Finish();
}
else
{

View File

@ -35,6 +35,7 @@
const PREF_RELOAD = true;
const PREF_WRITETHROUGH = true;
const PREF_CHARSET = "utf-8"; // string prefs stored in this charset
function PrefManager (branchName)
{
@ -211,7 +212,7 @@ function pm_s2a(string)
var ary = string.split(/\s*;\s*/);
for (var i = 0; i < ary.length; ++i)
ary[i] = unescape(ary[i]);
ary[i] = toUnicode(unescape(ary[i]), PREF_CHARSET);
return ary;
}
@ -221,7 +222,7 @@ function pm_a2s(ary)
{
var escapedAry = new Array()
for (var i = 0; i < ary.length; ++i)
escapedAry[i] = escape(ary[i]);
escapedAry[i] = escape(fromUnicode(ary[i], PREF_CHARSET));
return escapedAry.join("; ");
}
@ -273,7 +274,8 @@ function pm_getpref(prefName, reload)
else if (typeof defaultValue == "string" ||
defaultValue == null)
{
realValue = this.prefBranch.getCharPref(prefName);
realValue = toUnicode(this.prefBranch.getCharPref(prefName),
PREF_CHARSET);
}
}
catch (ex)
@ -334,7 +336,7 @@ function pm_setpref(prefName, value)
}
else
{
this.prefBranch.setCharPref(prefName, value);
this.prefBranch.setCharPref(prefName, fromUnicode(value, PREF_CHARSET));
}
this.prefService.savePrefFile(null);

View File

@ -213,6 +213,57 @@ function dumpObjectTree (o, recurse, compress, level)
}
function ecmaEscape(str)
{
function replaceNonPrintables(ch)
{
rv = ch.charCodeAt().toString(16);
if (rv.length == 1)
rv = "0" + rv;
else if (rv.length == 3)
rv = "u0" + rv;
else if (rv.length == 4)
rv = "u" + rv;
return "%" + rv;
};
// Replace any character that is not in the 69 character set
// [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./]
// with an escape sequence. Two digit sequences in the form %XX are used
// for characters whose codepoint is less than 255, %uXXXX for all others.
// See section B.2.1 of ECMA-262 rev3 for more information.
return str.replace(/[^A-Za-z0-9@*_+.\-\/]/g, replaceNonPrintables);
}
function ecmaUnescape(str)
{
function replaceEscapes(seq)
{
var ary = seq.match(/([\da-f]{1,2})(.*)|u([\da-f]{1,4})/);
if (!ary)
return "<ERROR>";
if (ary[1])
{
// two digit escape, possibly with cruft after
rv = String.fromCharCode(parseInt(ary[1], 16)) + ary[2];
}
else
{
// four digits, no cruft
rv = String.fromCharCode(parseInt(ary[3], 16));
}
return rv;
};
// Replace the escape sequences %X, %XX, %uX, %uXX, %uXXX, and %uXXXX with
// the characters they represent, where X is a hexadecimal digit.
// See section B.2.2 of ECMA-262 rev3 for more information.
return str.replace(/%u?([\da-f]{1,4})/ig, replaceEscapes);
}
function replaceVars(str, vars)
{
// replace "string $with a $variable", with
@ -820,3 +871,44 @@ function getURLSpecFromFile (file)
fileHandler = fileHandler.QueryInterface(nsIFileProtocolHandler);
return fileHandler.getURLSpecFromFile(file);
}
function alert(msg, parent, title)
{
var PROMPT_CTRID = "@mozilla.org/embedcomp/prompt-service;1";
var nsIPromptService = Components.interfaces.nsIPromptService;
var ps = Components.classes[PROMPT_CTRID].createInstance(nsIPromptService);
if (!parent)
parent = window;
if (!title)
title = MSG_ALERT;
ps.alert (parent, title, msg);
}
function confirm(msg, parent, title)
{
var PROMPT_CTRID = "@mozilla.org/embedcomp/prompt-service;1";
var nsIPromptService = Components.interfaces.nsIPromptService;
var ps = Components.classes[PROMPT_CTRID].createInstance(nsIPromptService);
if (!parent)
parent = window;
if (!title)
title = MSG_CONFIRM;
return ps.confirm (parent, title, msg);
}
function prompt(msg, initial, parent, title)
{
var PROMPT_CTRID = "@mozilla.org/embedcomp/prompt-service;1";
var nsIPromptService = Components.interfaces.nsIPromptService;
var ps = Components.classes[PROMPT_CTRID].createInstance(nsIPromptService);
if (!parent)
parent = window;
if (!title)
title = MSG_PROMPT;
rv = { value: initial };
if (!ps.prompt (parent, title, msg, rv, null, {value: null}))
return null;
return rv.value
}

View File

@ -1171,7 +1171,7 @@ function cmdMe(e)
e.action = filterOutput (e.action, "ACTION", "ME!");
display (e.action, "ACTION", "ME!", e.sourceObject);
e.sourceObject.act (fromUnicode(e.action, e.sourceObject));
e.sourceObject.act (e.action);
}
function cmdMotif(e)
@ -1295,7 +1295,7 @@ function cmdQuery(e)
{
e.message = filterOutput(e.message, "PRIVMSG", "ME!");
user.display(e.message, "PRIVMSG", "ME!", user);
user.say(fromUnicode(e.message, e.sourceObject));
user.say(e.message, e.sourceObject);
}
return user;
@ -1307,7 +1307,7 @@ function cmdMsg(e)
var msg = filterOutput(e.message, "PRIVMSG", "ME!");
usr.display(e.message, "PRIVMSG", "ME!", usr);
usr.say(fromUnicode(e.message, e.sourceObject));
usr.say(e.message, e.sourceObject);
}
function cmdNick(e)
@ -1556,7 +1556,7 @@ function cmdTopic(e)
if (!e.newTopic)
e.server.sendData ("TOPIC " + e.channel.name + "\n");
else
e.channel.setTopic(fromUnicode(e.newTopic, e.channel));
e.channel.setTopic(e.newTopic);
}
function cmdAbout(e)

View File

@ -573,7 +573,7 @@ function my_unknown (e)
client.responseCodeMap[e.code] = "---";
}
this.display (e.params.join(" "), e.code.toUpperCase());
this.display(toUnicode(e.params.join(" "), this), e.code.toUpperCase());
}
CIRCNetwork.prototype.on001 = /* Welcome! */
@ -600,7 +600,7 @@ function my_showtonet (e)
{
case "004":
case "005":
str = e.params.slice(3).join (" ");
str = e.params.slice(3).join(" ");
break;
case "001":
@ -613,7 +613,7 @@ function my_showtonet (e)
// reconnect to any existing views
var source = client.viewsArray[v].source;
var details = getObjectDetails(client.viewsArray[v].source);
if (source.TYPE != "CIRCUser" &&
if (source.TYPE != "IRCUser" &&
"network" in details && details.network == this)
{
gotoIRCURL(source.getURL());
@ -630,7 +630,12 @@ function my_showtonet (e)
delete this.pendingURLs;
}
str = e.params[2];
str = e.decodeParam(2);
if ("onLogin" in this)
{
ev = new CEvent("network", "login", this, "onLogin");
client.eventPump.addEvent(ev);
}
break;
case "372":
@ -641,27 +646,26 @@ function my_showtonet (e)
/* no break */
default:
var length = e.params.length;
str = e.params[length - 1];
str = e.decodeParam(e.params.length - 1);
break;
}
this.displayHere (p + str, e.code.toUpperCase());
this.displayHere(p + str, e.code.toUpperCase());
}
CIRCNetwork.prototype.onUnknownCTCPReply =
function my_ctcprunk (e)
{
this.display (getMsg(MSG_FMT_CTCPREPLY,
[e.CTCPCode, e.CTCPData, e.user.properNick]),
"CTCP_REPLY", e.user, e.server.me);
this.display(getMsg(MSG_FMT_CTCPREPLY,
[e.CTCPCode, e.CTCPData, e.user.properNick]),
"CTCP_REPLY", e.user, e.server.me, this);
}
CIRCNetwork.prototype.onNotice =
function my_notice (e)
{
this.display (toUnicode(e.params[2], this), "NOTICE", this, e.server.me);
this.display(e.decodeParam(2), "NOTICE", this, e.server.me);
}
CIRCNetwork.prototype.on303 = /* ISON (aka notify) reply */
@ -816,12 +820,13 @@ function my_listrply (e)
if (!("list" in this) || !("done" in this.list))
this.listInit();
++this.list.count;
e.params[2] = toUnicode(e.params[2], this);
if (!(this.list.regexp) || e.params[2].match(this.list.regexp)
|| e.params[4].match(this.list.regexp))
var chanName = e.decodeParam(2);
var topic = e.decodeParam(4);
if (!this.list.regexp || chanName.match(this.list.regexp) ||
topic.match(this.list.regexp))
{
this.list.push([e.params[2], e.params[3],
toUnicode(e.params[4], this)]);
this.list.push([chanName, e.params[3], topic]);
}
}
@ -840,7 +845,7 @@ function my_401 (e)
}
else
{
display(e.params[3]);
display(toUnicode(e.params[3], this));
}
}
@ -870,11 +875,11 @@ function my_352 (e)
if (ary)
{
hops = Number(ary[1]);
desc = ary[2];
desc = toUnicode(ary[2], this);
}
else
{
desc = e.params[length - 1];
desc = e.decodeParam(length - 1);
}
var status = e.params[7];
@ -883,10 +888,10 @@ function my_352 (e)
else if (e.params[7] == "H")
status = MSG_HERE;
e.user.display (getMsg(MSG_WHO_MATCH,
e.user.display(getMsg(MSG_WHO_MATCH,
[e.params[6], e.params[3], e.params[4],
desc, status,
toUnicode(e.params[2], this),
e.decodeParam(2),
e.params[5], hops]), e.code, e.user);
updateTitle (e.user);
if ("whoMatches" in this)
@ -914,11 +919,11 @@ function my_whoisreply (e)
case 311:
text = getMsg(MSG_WHOIS_NAME,
[nick, e.params[3], e.params[4],
toUnicode(e.params[6], this)]);
e.decodeParam(6)]);
break;
case 319:
var ary = stringTrim(e.params[3]).split(" ");
var ary = stringTrim(e.decodeParam(3)).split(" ");
text = getMsg(MSG_WHOIS_CHANNELS, [nick, arraySpeak(ary)]);
break;
@ -950,8 +955,7 @@ function my_whoisreply (e)
CIRCNetwork.prototype.on341 = /* invite reply */
function my_341 (e)
{
this.display (getMsg(MSG_YOU_INVITE, [e.params[2],
toUnicode(e.params[3], this)]),
this.display (getMsg(MSG_YOU_INVITE, [e.params[2], e.decodeParam(3)]),
"341");
}
@ -1044,7 +1048,7 @@ function my_netdisconnect (e)
default:
msg = getMsg(MSG_CLOSE_STATUS,
[this.name, e.server.hostname, e.server.port]);
[this.getURL(), e.server.getURL(), e.disconnectStatus]);
reconnect = true;
break;
}
@ -1098,8 +1102,7 @@ function my_umode (e)
if ("user" in e && e.user)
e.user.updateHeader();
display(getMsg(MSG_USER_MODE, [e.params[1], e.params[2]]),
MT_MODE);
display(getMsg(MSG_USER_MODE, [e.params[1], e.params[2]]), MT_MODE);
}
CIRCNetwork.prototype.onNick =
@ -1139,20 +1142,20 @@ function chan_oninit ()
CIRCChannel.prototype.onPrivmsg =
function my_cprivmsg (e)
{
var msg = e.decodeParam(2);
this.display (e.params[2], "PRIVMSG", e.user, this);
this.display (msg, "PRIVMSG", e.user, this);
if ((typeof client.prefix == "string") &&
e.params[2].indexOf (client.prefix) == 0)
msg.indexOf (client.prefix) == 0)
{
try
{
var v = eval(e.params[2].substring (client.prefix.length,
e.params[2].length));
var v = eval(msg.substring(client.prefix.length, msg.length));
}
catch (ex)
{
this.say(fromUnicode(e.user.nick + ": " + String(ex), this));
this.say(e.user.nick + ": " + String(ex));
return false;
}
@ -1170,8 +1173,8 @@ function my_cprivmsg (e)
else
rsp += " ";
this.display (rsp + v, "PRIVMSG", e.server.me, this);
this.say (fromUnicode(rsp + v, this));
this.display(rsp + v, "PRIVMSG", e.server.me, this);
this.say(rsp + v, this);
}
}
@ -1252,14 +1255,13 @@ function my_topic (e)
CIRCChannel.prototype.onNotice =
function my_notice (e)
{
this.display (toUnicode(e.params[2], this),
"NOTICE", e.user, this);
this.display(e.decodeParam(2), "NOTICE", e.user, this);
}
CIRCChannel.prototype.onCTCPAction =
function my_caction (e)
{
this.display (e.CTCPData, "ACTION", e.user, this);
this.display (toUnicode(e.CTCPData), "ACTION", e.user, this);
}
CIRCChannel.prototype.onUnknownCTCP =
@ -1368,7 +1370,7 @@ function my_cmode (e)
{
if ("user" in e)
{
var msg = toUnicode(e.params.slice(1).join(" "), this);
var msg = e.params.slice(1).join(" ");
this.display (getMsg(MSG_MODE_CHANGED, [msg, e.user.properNick]),
"MODE", e.user, this);
}
@ -1451,7 +1453,7 @@ function my_cprivmsg (e)
}
}
this.display (e.params[2], "PRIVMSG", e.user, e.server.me);
this.display(e.decodeParam(2), "PRIVMSG", e.user, e.server.me);
}
CIRCUser.prototype.onNick =
@ -1477,13 +1479,13 @@ function my_unick (e)
CIRCUser.prototype.onNotice =
function my_notice (e)
{
this.display (toUnicode(e.params[2], this), "NOTICE", this, e.server.me);
this.display (e.decodeParam(2), "NOTICE", this, e.server.me);
}
CIRCUser.prototype.onCTCPAction =
function my_uaction (e)
{
e.user.display (e.CTCPData, "ACTION", this, e.server.me);
e.user.display(toUnicode(e.CTCPData), "ACTION", this, e.server.me);
}
CIRCUser.prototype.onUnknownCTCP =

View File

@ -143,7 +143,8 @@ function initPrefs()
function pref_mungeName(name)
{
return escape(name.replace(/\./g, "-").replace(/:/g, "_").toLowerCase());
var safeName = name.replace(/\./g, "-").replace(/:/g, "_").toLowerCase();
return ecmaEscape(safeName);
}
function getNetworkPrefManager(network)

View File

@ -34,7 +34,7 @@
* Samuel Sieb, samuel@sieb.net, MIRC color codes, munger menu, and various
*/
const __cz_version = "0.9.35";
const __cz_version = "0.9.40";
const __cz_condition = "yellow";
var warn;
@ -367,7 +367,7 @@ function processStartupURLs()
"url" in window.arguments[0])
{
var url = window.arguments[0].url;
if (url.search(/^irc:\/?\/?$/i) == -1)
if (url.search(/^irc:\/?\/?\/?$/i) == -1)
{
/* if the url is not irc: irc:/ or irc://, then go to it. */
gotoIRCURL(url);
@ -515,10 +515,10 @@ function insertChannelLink (matchText, containerTag, eventData)
}
var encodedMatchText = fromUnicode(matchText, eventData.sourceObject);
var anchor = document.createElementNS ("http://www.w3.org/1999/xhtml",
"html:a");
var anchor = document.createElementNS("http://www.w3.org/1999/xhtml",
"html:a");
anchor.setAttribute ("href", eventData.network.getURL() +
escape(encodedMatchText));
ecmaEscape(encodedMatchText));
anchor.setAttribute ("class", "chatzilla-link");
insertHyphenatedWord (matchText, anchor);
containerTag.appendChild (anchor);
@ -1310,7 +1310,7 @@ function gotoIRCURL (url)
if (url.needpass)
{
if ("pass" in url)
if (url.pass)
pass = url.pass;
else
pass = window.prompt(getMsg(MSG_URL_PASSWORD, url.spec));
@ -1399,7 +1399,7 @@ function gotoIRCURL (url)
}
var charset;
if ("charset" in url)
if (url.charset)
charset = url.charset;
targetObject = network.dispatch("join",
@ -1424,7 +1424,7 @@ function gotoIRCURL (url)
targetObject.display(msg, "PRIVMSG", "ME!",
client.currentObject);
}
targetObject.say(fromUnicode(msg, targetObject));
targetObject.say(msg);
setCurrentObject(targetObject);
}
}
@ -2308,8 +2308,8 @@ function cli_say(msg)
case "IRCUser":
case "IRCChanUser":
msg = filterOutput (msg, "PRIVMSG");
display (msg, "PRIVMSG", "ME!", client.currentObject);
client.currentObject.say(fromUnicode(msg));
display(msg, "PRIVMSG", "ME!", client.currentObject);
client.currentObject.say(msg);
break;
case "IRCClient":
@ -2350,6 +2350,18 @@ function net_getprefmgr()
return this._prefManager;
}
CIRCServer.prototype.__defineGetter__("prefs", srv_getprefs);
function srv_getprefs()
{
return this.parent.prefs;
}
CIRCServer.prototype.__defineGetter__("prefManager", srv_getprefmgr);
function srv_getprefmgr()
{
return this.parent.prefManager;
}
CIRCChannel.prototype.__defineGetter__("prefs", chan_getprefs);
function chan_getprefs()
{
@ -2558,12 +2570,12 @@ function __display(message, msgtype, sourceObj, destObj)
var name;
if (sourceObj)
{
name = (sourceObj.TYPE == "CIRCChannel") ?
name = (sourceObj.TYPE == "IRCChannel") ?
sourceObj.unicodeName : sourceObj.name;
}
else
{
name = (this.TYPE == "CIRCChannel") ?
name = (this.TYPE == "IRCChannel") ?
this.unicodeName : this.name;
}
@ -2792,7 +2804,7 @@ function __display(message, msgtype, sourceObj, destObj)
try
{
this.logFile.write(logText + "\n");
this.logFile.write(fromUnicode(logText + "\n", "utf-8"));
}
catch (ex)
{

View File

@ -26,6 +26,12 @@ unknown=<unknown>
none=<none>
na=<n/a>
# util.js
msg.alert = Alert
msg.prompt = Prompt
msg.confirm = Confirm
# command.js
cmd.about.label = About ChatZilla