1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-03 21:23:12 +02:00

Remove set::maxbanlength as it is not useful and only confusing.

https://www.unrealircd.org/docs/Set_block#set::maxbanlength
This commit is contained in:
Bram Matthys
2023-05-28 20:25:02 +02:00
parent 23bddde416
commit bb419b95d1
5 changed files with 11 additions and 22 deletions
+5
View File
@@ -111,6 +111,11 @@ in progress and may not be a stable version.
* The [`require module` block](https://www.unrealircd.org/docs/Require_module_block)
was only checked of one side of the link, thus partially not working.
### Removed:
* [set::maxbanlength](https://www.unrealircd.org/docs/Set_block#set::maxbanlength)
has been removed as it was not deemed useful and only confusing
to users and admins.
### Developers and protocol:
* Server to server lines can now be 16384 bytes in size when
`PROTOCTL BIGLINES` is set. This will allow us to do things more
-3
View File
@@ -126,7 +126,6 @@ struct Configuration {
int spamfilter_stop_on_first_match;
int spamfilter_utf8;
int maxbans;
int maxbanlength;
int watch_away_notification;
int uhnames;
unsigned short default_ipv6_clone_mask;
@@ -249,7 +248,6 @@ extern MODVAR int ipv6_disabled;
#define CHECK_TARGET_NICK_BANS iConf.check_target_nick_bans
#define MAXBANS iConf.maxbans
#define MAXBANLENGTH iConf.maxbanlength
#define WATCH_AWAY_NOTIFICATION iConf.watch_away_notification
@@ -299,7 +297,6 @@ struct SetCheck {
unsigned has_default_bantime:1;
unsigned has_who_limit:1;
unsigned has_maxbans:1;
unsigned has_maxbanlength:1;
unsigned has_silence_limit:1;
unsigned has_ban_version_tkl_time:1;
unsigned has_spamfilter_ban_time:1;
+4 -9
View File
@@ -249,15 +249,14 @@ int identical_ban(const char *one, const char *two)
int add_listmode_ex(Ban **list, Client *client, Channel *channel, const char *banid, const char *setby, time_t seton)
{
Ban *ban;
int cnt = 0, len;
int cnt = 0;
int do_not_add = 0;
char isnew = 0;
//if (MyUser(client))
// collapse(banid);
len = strlen(banid);
if (!*list && ((len > MAXBANLENGTH) || (MAXBANS < 1)))
if (!*list && (MAXBANS < 1))
{
if (MyUser(client))
{
@@ -268,14 +267,10 @@ int add_listmode_ex(Ban **list, Client *client, Channel *channel, const char *ba
}
for (ban = *list; ban; ban = ban->next)
{
len += strlen(ban->banstr);
/* Check MAXBANLENGTH / MAXBANS only for local clients
* and 'me' (for +b's set during +f).
/* Check MAXBANS only for local clients and 'me' (for +b's set during +f).
*/
if ((MyUser(client) || IsMe(client)) && ((len > MAXBANLENGTH) || (++cnt >= MAXBANS)))
{
if ((MyUser(client) || IsMe(client)) && (++cnt >= MAXBANS))
do_not_add = 1;
}
if (identical_ban(ban->banstr, banid))
break; /* update existing ban (potentially) */
}
+2 -6
View File
@@ -1680,7 +1680,6 @@ void config_setdefaultsettings(Configuration *i)
safe_strdup(i->channel_command_prefix, "`!.");
i->check_target_nick_bans = 1;
i->maxbans = 60;
i->maxbanlength = 2048;
safe_strdup(i->level_on_join, "o");
i->watch_away_notification = 1;
i->uhnames = 1;
@@ -7600,9 +7599,6 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cep->name, "maxbans")) {
tempiConf.maxbans = atol(cep->value);
}
else if (!strcmp(cep->name, "maxbanlength")) {
tempiConf.maxbanlength = atol(cep->value);
}
else if (!strcmp(cep->name, "silence-limit")) {
tempiConf.silence_limit = atol(cep->value);
}
@@ -8275,8 +8271,8 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
CheckDuplicate(cep, maxbans, "maxbans");
}
else if (!strcmp(cep->name, "maxbanlength")) {
CheckNull(cep);
CheckDuplicate(cep, maxbanlength, "maxbanlength");
config_warn("%s:%d: set::maxbanlength no longer exists as it was not deemed useful, this setting is now ignored.",
cep->file->filename, cep->line_number);
}
else if (!strcmp(cep->name, "silence-limit")) {
CheckNull(cep);
-4
View File
@@ -31,10 +31,6 @@
* that do not have halfops or higher, and only channels that have any
* textbans set.
* UPDATE: The speed impact for 15 bans per channel is 42 usec PEAK.
* HINT: If you are hitting the "normal banlimit" before you actually hit this
* one, then you might want to tweak the #define MAXBANS and #define
* MAXBANLENGTH in include/struct.h. Doubling MAXBANLENGTH is usually
* a good idea, and then you can enlarge MAXBANS too a bit if you want to.
*/
#define MAX_EXTBANT_PER_CHAN 15 /* Max number of ~T bans in a channel. */