add:   for (var i = 0; i < client.awayMsgs.length; i++) { if (client.awayMsgs[i].message == e.reason) { client.awayMsgs.splice(i, 1); break; } }  var newMsg = { message: e.reason }; client.awayMsgs.unshift(newMsg);  if (client.awayMsgs.length > client.awayMsgCount) client.awayMsgs.splice(client.awayMsgCount);  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); } 
context: function cmdAway(e){    function sendToAllNetworks(command, reason)    {        for (var n in client.networks)        {            if (client.networks[n].primServ &&                (client.networks[n].state == NET_ONLINE))            {                client.networks[n].dispatch(command, { reason: reason });            }        }    };    if ((e.command.name == "away") || (e.command.name == "custom-away"))    {        /* going away */        if (e.command.name == "custom-away")        {            e.reason = prompt(MSG_AWAY_PROMPT);            // prompt() returns null for cancelling, a string otherwise (even if empty).            if (e.reason == null)                return;        }        // No parameter, or user entered nothing in the prompt.        if (!e.reason)            e.reason = MSG_AWAY_DEFAULT;        if (e.server)        {            if (e.network.state == NET_ONLINE)            {                if (e.network.prefs["awayNick"])                    e.server.sendData("NICK " + e.network.prefs["awayNick"] + "\n");                e.server.sendData("AWAY :" + fromUnicode(e.reason, e.network) + "\n");            }            e.network.prefs["away"] = e.reason;        }        else        {            // Client view, do command for all networks.            sendToAllNetworks("away", e.reason);            display(getMsg(MSG_AWAY_ON, e.reason));        }    }    else    {        /* returning */        if (e.server)        {            if (e.network.state == NET_ONLINE)            {                if (e.network.prefs["awayNick"])                    e.server.sendData("NICK " + e.network.prefs["nickname"] + "\n");                e.server.sendData("AWAY\n");            }            e.network.prefs["away"] = "";        }        else        {            // Client view, do command for all networks.            sendToAllNetworks("back");            display(MSG_AWAY_OFF);        }    }}
meta: 1622	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1622/eae94c398187e9250f78b32b839b4530babf00ef/commands.js/buggy/xul/content/commands.js