diff --git a/mozilla/extensions/irc/jar.mn b/mozilla/extensions/irc/jar.mn
index a237a515171..4e3f8ff6cfa 100644
--- a/mozilla/extensions/irc/jar.mn
+++ b/mozilla/extensions/irc/jar.mn
@@ -13,6 +13,7 @@ chatzilla.jar:
content/chatzilla/lib/js/irc-debug.js (js/lib/irc-debug.js)
content/chatzilla/lib/js/file-utils.js (js/lib/file-utils.js)
content/chatzilla/lib/js/dcc.js (js/lib/dcc.js)
+ content/chatzilla/lib/js/text-serializer.js (js/lib/text-serializer.js)
content/chatzilla/lib/xul/munger.js (xul/lib/munger.js)
content/chatzilla/lib/xul/tree-utils.js (xul/lib/tree-utils.js)
content/chatzilla/chatzilla.xul (xul/content/chatzilla.xul)
diff --git a/mozilla/extensions/irc/xul/content/commands.js b/mozilla/extensions/irc/xul/content/commands.js
index 07115518594..976807c0cc4 100644
--- a/mozilla/extensions/irc/xul/content/commands.js
+++ b/mozilla/extensions/irc/xul/content/commands.js
@@ -2572,6 +2572,38 @@ function cmdAway(e)
if (!e.reason)
e.reason = MSG_AWAY_DEFAULT;
+ // Update away list (remove from current location).
+ for (var i = 0; i < client.awayMsgs.length; i++)
+ {
+ if (client.awayMsgs[i].message == e.reason)
+ {
+ client.awayMsgs.splice(i, 1);
+ break;
+ }
+ }
+ // Always put new item at start.
+ var newMsg = { message: e.reason };
+ client.awayMsgs.unshift(newMsg);
+ // Make sure we've not exceeded the limit set.
+ if (client.awayMsgs.length > client.awayMsgCount)
+ client.awayMsgs.splice(client.awayMsgCount);
+ // And now, to save the list!
+ try
+ {
+ var awayFile = new nsLocalFile(client.prefs["profilePath"]);
+ awayFile.append("awayMsgs.txt");
+ var awayLoader = new TextSerializer(awayFile);
+ if (awayLoader.open(">"))
+ {
+ awayLoader.serialize(client.awayMsgs);
+ awayLoader.close();
+ }
+ }
+ catch(ex)
+ {
+ display(getMsg(MSG_ERR_AWAY_SAVE, formatException(ex)), MT_ERROR);
+ }
+
if (e.server)
{
if (e.network.state == NET_ONLINE)
diff --git a/mozilla/extensions/irc/xul/content/scripts.xul b/mozilla/extensions/irc/xul/content/scripts.xul
index 45de7e1bfc8..e270b335eaa 100644
--- a/mozilla/extensions/irc/xul/content/scripts.xul
+++ b/mozilla/extensions/irc/xul/content/scripts.xul
@@ -70,6 +70,7 @@
+
diff --git a/mozilla/extensions/irc/xul/content/static.js b/mozilla/extensions/irc/xul/content/static.js
index b29661e99e5..53e87ecd859 100644
--- a/mozilla/extensions/irc/xul/content/static.js
+++ b/mozilla/extensions/irc/xul/content/static.js
@@ -43,7 +43,7 @@ const __cz_version = "0.9.67+";
const __cz_condition = "green";
const __cz_suffix = "";
const __cz_guid = "59c81df5-4b7a-477b-912d-4e0fdf64e5f2";
-const __cz_locale = "0.9.67.3";
+const __cz_locale = "0.9.67.4";
var warn;
var ASSERT;
@@ -116,6 +116,8 @@ client.inputHistory = new Array();
client.lastHistoryReferenced = -1;
client.incompleteLine = "";
client.lastTabUp = new Date();
+client.awayMsgs = new Array();
+client.awayMsgCount = 5;
CIRCNetwork.prototype.INITIAL_CHANNEL = "";
CIRCNetwork.prototype.MAX_MESSAGES = 100;
@@ -343,6 +345,34 @@ function initStatic()
setInterval("onNotifyTimeout()", client.NOTIFY_TIMEOUT);
setInterval("onWhoTimeout()", client.AWAY_TIMEOUT);
+ client.awayMsgs = [{ message: MSG_AWAY_DEFAULT }];
+ var awayFile = new nsLocalFile(client.prefs["profilePath"]);
+ awayFile.append("awayMsgs.txt");
+ if (awayFile.exists())
+ {
+ var awayLoader = new TextSerializer(awayFile);
+ if (awayLoader.open("<"))
+ {
+ // Load the first item from the file.
+ var item = awayLoader.deserialize();
+ if (item instanceof Array)
+ {
+ // If the first item is an array, it is the entire thing.
+ client.awayMsgs = item;
+ }
+ else
+ {
+ /* Not an array, so we have the old format of a single object
+ * per entry.
+ */
+ client.awayMsgs = [item];
+ while ((item = awayLoader.deserialize()))
+ client.awayMsgs.push(item);
+ }
+ awayLoader.close();
+ }
+ }
+
client.defaultCompletion = client.COMMAND_CHAR + "help ";
client.deck = document.getElementById('output-deck');
diff --git a/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties b/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties
index 7ee9748652c..8b0d22771cc 100644
--- a/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties
+++ b/mozilla/extensions/irc/xul/locale/en-US/chatzilla.properties
@@ -69,7 +69,7 @@
#
### End of notes ###
-locale.version = 0.9.67.3
+locale.version = 0.9.67.4
locale.error = You are using ChatZilla %1$S, which requires the locale version %2$S. The currently selected locale, %3$S, is version %4$S, and therefore there may be problems running ChatZilla.\n\nIt is strongly advised that you update or remove the ChatZilla locale in question.
# Misc
@@ -112,6 +112,7 @@ cmd.attach.params =
cmd.attach.help = Attaches to the IRC URL specified by . If you are already attached, the view for is made current. If that view has been deleted, it is recreated. You may omit the irc:// portion of the . Examples are; /attach moznet, /attach moznet/chatzilla, and /attach irc.mozilla.org/mozbot,isnick.
cmd.away.label = Away (default)
+cmd.away.format = Away ($reason)
cmd.away.params = []
cmd.away.help = If is specified, sets you away with that message. Used without , you are marked away with a default message.
@@ -716,6 +717,7 @@ msg.err.unknown.host = The host application URL "%S" is not recognised. Please
msg.err.unable.to.print = The current view does not support printing.
msg.err.unsupported.command = The server does not support the ``%S'' command.
msg.err.invalid.mode = The mode string you entered (``%S'') is invalid. A valid mode string consists of one or more sequences of a + or - followed by one or more alphabetical characters.
+msg.err.away.save = Saving the list of away messages failed (%S).
# Ask for oper pass if not explicitly given in the command:
msg.need.oper.password = Please enter a password for obtaining IRC Operator privileges.
@@ -1123,7 +1125,7 @@ msg.someone.gone = "%S was booted from %S by %S (%S)
msg.mode.changed = Mode %S by %S"
-msg.away.on = You are now marked as away (%S).
+msg.away.on = You are now marked as away (%S). Click the nickname button or use the |/back| command to return from being away.
msg.away.off = You are no longer marked as away.
msg.away.prompt = Enter an away message to use:
msg.away.default = User is away.