changes between 0.9.40 and 0.9.44:

* Revision 0.9.44 fixes some more charset related problems. The user description is now properly decoded for /query views, and the channel name for mode messages.

* Revision 0.9.43 fixes the ``unknown CTCP'' handler, so that it displays the correct diagnostic, instead of ``my_unkctcpMsg''.

* Revision 0.9.42 fixes charset problems with part reasons, and another charset problem with kick messages. It also deals with spaces in nicknames and usernames by replacing them with underscores, instead of just failing to log in. This revision also makes it so that you no longer need to restart ChatZilla after changing your description or username.

* Revision 0.9.41 adds an ``autoperform'' pref to networks that can be used to execute arbitrary ChatZilla commands when you connect to a network. These autoperform commands will be executed before any of your ``Open At Startup'' channels are processed. This release also makes ChatZilla recognize the optional ``reason'' parameter for PART messages. Many IRC servers do not yet support PART reasons, so don't be surprised if you don't see any.
This commit is contained in:
rginda%netscape.com 2003-10-21 23:47:35 +00:00
parent a27693468b
commit bf75ef4d6d
7 changed files with 74 additions and 32 deletions

View File

@ -406,11 +406,14 @@ function serv_flush()
CIRCServer.prototype.login =
function serv_login(nick, name, desc)
{
this.me = new CIRCUser (this, nick, name);
nick = nick.replace(" ", "_");
name = name.replace(" ", "_");
this.me = new CIRCUser(this, nick, name);
if (this.password)
this.sendData ("PASS " + this.password + "\n");
this.sendData ("NICK " + nick + "\n");
this.sendData ("USER " + name + " foo bar :" +
this.sendData("PASS " + this.password + "\n");
this.sendData("NICK " + nick + "\n");
this.sendData("USER " + name + " foo bar :" +
fromUnicode(desc, this) + "\n");
}
@ -905,8 +908,8 @@ function serv_332 (e)
CIRCServer.prototype.on311 =
function serv_311 (e)
{
e.user = new CIRCUser (this, e.params[2], e.params[3], e.params[4],
e.params[6]);
e.user = new CIRCUser (this, e.params[2], e.params[3], e.params[4]);
e.user.desc = e.decodeParam(6, e.user);
e.destObject = this.parent;
e.set = "network";
}
@ -955,7 +958,7 @@ function serv_352 (e)
if (8 in e.params)
{
var ary = e.params[8].match(/(?:\d+\s)?(.*)/);
e.user.desc = ary[1];
e.user.desc = fromUnicode(ary[1], e.user);
}
e.destObject = this.parent;
@ -1352,6 +1355,7 @@ CIRCServer.prototype.onPart =
function serv_part (e)
{
e.channel = new CIRCChannel (this, e.params[1]);
e.reason = (e.params.length > 1) ? e.decodeParam(2, e.channel) : "";
e.user = new CIRCChanUser (e.channel, e.user.nick);
if (userIsMe(e.user))
e.channel.active = false;
@ -1370,7 +1374,7 @@ function serv_kick (e)
delete e.channel.users[e.lamer.nick];
if (userIsMe(e.lamer))
e.channel.active = false;
e.reason = e.decodeParam(3);
e.reason = e.decodeParam(3, e.channel);
e.destObject = e.channel;
e.set = "channel";
@ -2037,11 +2041,10 @@ function chan_secret (f)
* user
*/
function CIRCUser (parent, nick, name, host, desc)
function CIRCUser (parent, nick, name, host)
{
var properNick = nick;
nick = nick.toLowerCase();
if (nick in parent.users)
{
var existingUser = parent.users[nick];
@ -2049,8 +2052,6 @@ function CIRCUser (parent, nick, name, host, desc)
existingUser.name = name;
if (host)
existingUser.host = host;
if (desc)
existingUser.desc = desc;
return existingUser;
}
@ -2059,7 +2060,6 @@ function CIRCUser (parent, nick, name, host, desc)
this.properNick = properNick;
this.name = name;
this.host = host;
this.desc = desc;
this.connectionHost = null;
this.modestr = this.parent.parent.INITIAL_UMODE;

View File

@ -177,7 +177,15 @@ function dumpObjectTree (o, recurse, compress, level)
break;
case "object":
s += pfx + tee + i + " (object)\n";
s += pfx + tee + i + " (object)";
if (o[i] == null)
{
s += " null\n";
break;
}
s += "\n";
if (!compress)
s += pfx + "|\n";
if ((i != "parent") && (recurse))

View File

@ -1482,7 +1482,11 @@ function cmdLeave(e)
if (e.channel && e.noDelete)
e.channel.noDelete = true;
e.server.sendData("PART " + e.channelName + "\n");
if (!e.reason)
e.reason = "";
e.server.sendData("PART " + e.channelName + " :" +
fromUnicode(e.reason, e.channel) + "\n");
}
function cmdLoad (e)

View File

@ -608,6 +608,11 @@ function my_showtonet (e)
this.updateHeader();
client.updateHeader();
updateStalkExpression(this);
var cmdary = this.prefs["autoperform"];
for (var i = 0; i < cmdary.length; ++i)
this.dispatch(cmdary[i])
for (var v in client.viewsArray)
{
// reconnect to any existing views
@ -619,6 +624,7 @@ function my_showtonet (e)
gotoIRCURL(source.getURL());
}
}
if ("pendingURLs" in this)
{
var url = this.pendingURLs.pop();
@ -1267,7 +1273,7 @@ function my_caction (e)
CIRCChannel.prototype.onUnknownCTCP =
function my_unkctcp (e)
{
this.display (getMsg("my_unkctcpMsg", [e.CTCPCode, e.CTCPData,
this.display (getMsg(MSG_UNKNOWN_CTCP, [e.CTCPCode, e.CTCPData,
e.user.properNick]),
"BAD-CTCP", e.user, this);
}
@ -1322,11 +1328,21 @@ function my_cpart (e)
this.dispatch("delete");
}
else
{
if (e.reason)
{
this.display (getMsg(MSG_SOMEONE_LEFT_REASON,
[e.user.properNick, e.channel.unicodeName,
e.reason]),
"PART", e.user, this);
}
else
{
this.display (getMsg(MSG_SOMEONE_LEFT,
[e.user.properNick, e.channel.unicodeName]),
"PART", e.user, this);
}
}
e.channel.updateHeader();
}
@ -1370,7 +1386,7 @@ function my_cmode (e)
{
if ("user" in e)
{
var msg = e.params.slice(1).join(" ");
var msg = e.decodeParam(1) + " " + e.params.slice(2).join(" ");
this.display (getMsg(MSG_MODE_CHANGED, [msg, e.user.properNick]),
"MODE", e.user, this);
}

View File

@ -175,7 +175,8 @@ function getNetworkPrefManager(network)
["outputWindowURL", defer],
["reconnect", defer],
["username", defer],
["usermode", defer]
["usermode", defer],
["autoperform", []]
];
var branch = "extensions.irc.networks." + pref_mungeName(network.name) +
@ -184,10 +185,22 @@ function getNetworkPrefManager(network)
prefManager.addPrefs(prefs);
prefManager.onPrefChanged = onPrefChanged;
network.INITIAL_NICK = prefManager.prefs["nickname"];
network.INITIAL_NAME = prefManager.prefs["username"];
network.INITIAL_DESC = prefManager.prefs["desc"];
network.INITIAL_UMODE = prefManager.prefs["usermode"];
var value = prefManager.prefs["nickname"];
if (value != CIRCNetwork.prototype.INITIAL_NICK)
network.INITIAL_NICK = value;
value = prefManager.prefs["username"];
if (value != CIRCNetwork.prototype.INITIAL_NAME)
network.INITIAL_NAME = value;
value = prefManager.prefs["desc"];
if (value != CIRCNetwork.prototype.INITIAL_DESC)
network.INITIAL_DESC = value;
value = prefManager.prefs["usermode"];
if (value != CIRCNetwork.prototype.INITIAL_UMODE)
network.INITIAL_UMODE = value;
network.stayingPower = prefManager.prefs["reconnect"];
client.prefManagers.push(prefManager);

View File

@ -34,8 +34,8 @@
* Samuel Sieb, samuel@sieb.net, MIRC color codes, munger menu, and various
*/
const __cz_version = "0.9.40";
const __cz_condition = "yellow";
const __cz_version = "0.9.44";
const __cz_condition = "green";
var warn;
var ASSERT;

View File

@ -185,8 +185,8 @@ cmd.kick-ban.help = Bans *!username@hostmask from the current channel, then ki
cmd.leave.format = Leave $channelName
cmd.leave.label = Leave
cmd.leave.params = [<channel-name> [<no-delete>]
cmd.leave.help = Leaves the current channel, use /delete or /hide to force the view to go away. If <no-delete> is provided and is |true|, |on|, |yes|, or |1|, the the tab will not be deleted.
cmd.leave.params = [<channel-name> [<reason>]]
cmd.leave.help = Leaves the current channel, use /delete or /hide to force the view to go away. Many servers do not support the optional <reason> parameter. If you are dispatching this command from script, you may also specify the <no-delete> parameter. If this is provided and is |true|, |on|, |yes|, or |1|, the the tab will not be deleted.
cmd.list.params = [<channel-name>]
cmd.list.help = Lists channel name, user count, and topic information for the network/server you are attached to. If you omit the optional channel argument, all channels will be listed. On large networks, the server may disconnect you for asking for a complete list.
@ -616,6 +616,7 @@ msg.you.joined = YOU have joined %S
msg.someone.joined = %S (%S@%S) has joined %S
msg.you.left = YOU have left %S
msg.someone.left = %S has left %S
msg.someone.left.reason = %S has left %S (%S)
msg.youre.gone = YOU have been booted from %S by %S (%S)
msg.someone.gone = %S was booted from %S by %S (%S)