Bug 396156 - Show a warning before doing /list or /rlist

p=rdmsoft@bugs.rdmsoft.com (Rob Marshall)
r=silver@warwickcompsoc.co.uk (James Ross)
ChatZilla Only. NPOTFFB.


git-svn-id: svn://10.0.0.236/trunk@240224 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gijskruitbosch%gmail.com
2007-12-01 17:10:16 +00:00
parent 07a5dcf298
commit 9fc2dfde1e
4 changed files with 37 additions and 9 deletions

View File

@@ -488,6 +488,7 @@ function CIRCServer (parent, hostname, port, isSecure, password)
s.supports = null;
s.channelTypes = null;
s.channelModes = null;
s.channelCount = -1;
s.userModes = null;
s.maxLineLength = 400;
@@ -1588,6 +1589,15 @@ function serv_251(e)
e.set = "network";
}
/* channels */
CIRCServer.prototype.on254 =
function serv_254(e)
{
this.channelCount = e.params[2];
e.destObject = this.parent;
e.set = "network";
}
/* user away message */
CIRCServer.prototype.on301 =
function serv_301(e)

View File

@@ -1181,6 +1181,7 @@ msg.nick.prompt = Enter a nickname to use:
msg.list.rerouted = List reply will appear on the ``%S'' view.
msg.list.end = Displayed %S of %S channels.
msg.list.chancount = This server has %S channels. Listing them all will probably take a long time, and may lead to ChatZilla becoming unresponsive or being disconnected by the server. [[List Channels][List all channels][%S]]
msg.who.end = End of WHO results for ``%S'', %S user(s) found.
msg.who.match = User %S, (%S@%S) ``%S'' (%S), member of %S, is connected to <irc://%S/>, %S hop(s).

View File

@@ -2038,7 +2038,19 @@ function cmdMotif(e)
function cmdList(e)
{
if (!e.channelName)
{
e.channelName = "";
var c = e.server.channelCount;
if ((c > client.SAFE_LIST_COUNT) && !("listWarned" in e.network))
{
client.munger.getRule(".inline-buttons").enabled = true;
display(getMsg(MSG_LIST_CHANCOUNT, [c, "list"]), MT_WARN);
client.munger.getRule(".inline-buttons").enabled = false;
e.network.listWarned = true;
return;
}
}
e.network.list(e.channelName);
}
@@ -2086,6 +2098,16 @@ function cmdRlist(e)
display(MSG_ERR_INVALID_REGEX, MT_ERROR);
return;
}
var c = e.server.channelCount;
if ((c > client.SAFE_LIST_COUNT) && !("listWarned" in e.network))
{
client.munger.getRule(".inline-buttons").enabled = true;
display(getMsg(MSG_LIST_CHANCOUNT, [c, "rlist " + e.regexp]), MT_WARN);
client.munger.getRule(".inline-buttons").enabled = false;
e.network.listWarned = true;
return;
}
e.network.list(re);
}

View File

@@ -79,10 +79,6 @@ client.MAX_NICK_DISPLAY = 14;
/* longest word to show in display before abbreviating */
client.MAX_WORD_DISPLAY = 20;
client.MAX_MSG_PER_ROW = 3; /* default number of messages to collapse into a
* single row, max. */
client.INITIAL_COLSPAN = 5; /* MAX_MSG_PER_ROW cannot grow to greater than
* one half INITIAL_COLSPAN + 1. */
client.NOTIFY_TIMEOUT = 5 * 60 * 1000; /* update notify list every 5 minutes */
// Check every minute which networks have away statuses that need an update.
@@ -95,14 +91,13 @@ client.SLOPPY_NETWORKS = true; /* true if msgs from a network can be displayed
* is on the network that the results came from)
*/
client.DOUBLETAB_TIME = 500;
client.IMAGEDIR = "chrome://chatzilla/skin/images/";
client.HIDE_CODES = true; /* true if you'd prefer to show numeric response
* codes as some default value (ie, "===") */
/* true if the browser widget shouldn't be allowed to take focus. windows, and
* probably the mac, need to be able to give focus to the browser widget for
* copy to work properly. */
client.NO_BROWSER_FOCUS = (navigator.platform.search(/mac|win/i) == -1);
client.DEFAULT_RESPONSE_CODE = "===";
/* Maximum number of channels we'll try to list without complaining */
client.SAFE_LIST_COUNT = 500;
/* Minimum number of users above or below the conference limit the user count
* must go, before it is changed. This allows the user count to fluctuate
* around the limit without continously going on and off.