From: Michael Poole Date: Tue, 12 Jul 2005 02:47:09 +0000 (+0000) Subject: Add CHANNELLEN feature, analogous to NICKLEN feature. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=adf5a0ef4e40b2bd6c3c7af64bc1762f315616fd Add CHANNELLEN feature, analogous to NICKLEN feature. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1443 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index a468cb2..d0c853e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2005-07-11 Michael Poole + + * doc/readme.features: Document FEAT_CHANNELLEN. + + * doc/example.conf: Give an example of it. + + * ircd/m_join.c (ms_join): Do not clean channel names from remote + servers, to avoid desynchs. + + * ircd/m_names.c (ms_names): Likewise. + +2005-07-11 Stephan Peijnik + + * include/ircd_features.h: Declare new FEAT_CHANNELLEN. + + * include/supported.h: Add it to the ISUPPORT display. + + * ircd/channel.c (clean_channelname): Impose the lower limit + between FEAT_CHANNELLEN and CHANNELLEN. + + * ircd/ircd_features.c: Define FEAT_CHANNELLEN. + 2005-07-11 Reed Loden * include/sys.h: Move FD_SETSIZE redefinition to engine_select.c. diff --git a/doc/example.conf b/doc/example.conf index 6407f1d..da47f13 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -805,6 +805,7 @@ features # "IPCHECK_CLONE_LIMIT" = "4"; # "IPCHECK_CLONE_PERIOD" = "40"; # "IPCHECK_CLONE_DELAY" = "600"; +# "CHANNELLEN" = "200"; # "CONFIG_OPERCMDS" = "FALSE"; # "OPLEVELS" = "TRUE"; # "LOCAL_CHANNELS" = "TRUE"; diff --git a/doc/readme.features b/doc/readme.features index 4a3ed80..63fa54d 100644 --- a/doc/readme.features +++ b/doc/readme.features @@ -848,3 +848,11 @@ TOPIC_BURST If set, send the current topic value and timestamp for channels during burst. This generally only makes sense for hubs to use, and it causes a large increase in net.burst size. + +CHANNELLEN + * Type: integer + * Default: 200 + +This is the allowed length of locally created channels. It may not be +larger than the CHANNELLEN #define. Like the NICKLEN feature, this is +intended to ease changes in channel name length across a network. diff --git a/include/ircd_features.h b/include/ircd_features.h index e4b2f4e..fae743c 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -77,6 +77,7 @@ enum Feature { FEAT_IPCHECK_CLONE_LIMIT, FEAT_IPCHECK_CLONE_PERIOD, FEAT_IPCHECK_CLONE_DELAY, + FEAT_CHANNELLEN, /* Some misc. default paths */ FEAT_MPATH, diff --git a/include/supported.h b/include/supported.h index 74d16f1..09a581c 100644 --- a/include/supported.h +++ b/include/supported.h @@ -47,7 +47,8 @@ " TOPICLEN=%i" \ " AWAYLEN=%i" \ " KICKLEN=%i" \ - " CHANNELLEN=%i" + " CHANNELLEN=%i" \ + " MAXCHANNELLEN=%i" #define FEATURES2 "CHANTYPES=%s" \ " PREFIX=%s" \ @@ -59,7 +60,8 @@ #define FEATURESVALUES1 feature_int(FEAT_MAXSILES), MAXMODEPARAMS, \ feature_int(FEAT_MAXCHANNELSPERUSER), \ feature_int(FEAT_MAXBANS), feature_int(FEAT_NICKLEN), \ - NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN, CHANNELLEN + NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN, \ + feature_int(FEAT_CHANNELLEN), CHANNELLEN #define FEATURESVALUES2 (feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#"), "(ov)@+", "@+", \ (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrD" : "b,k,l,imnpstrD"), \ diff --git a/ircd/channel.c b/ircd/channel.c index ff12cc1..36f8727 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -1288,7 +1288,8 @@ void clean_channelname(char *cn) int i; for (i = 0; cn[i]; i++) { - if (i >= CHANNELLEN || !IsChannelChar(cn[i])) { + if (i >= IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN)) + || !IsChannelChar(cn[i])) { cn[i] = '\0'; return; } diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index aa5acf3..26a0289 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -316,6 +316,7 @@ static struct FeatureDesc { F_I(IPCHECK_CLONE_LIMIT, 0, 4, 0), F_I(IPCHECK_CLONE_PERIOD, 0, 40, 0), F_I(IPCHECK_CLONE_DELAY, 0, 600, 0), + F_I(CHANNELLEN, 0, 200, 0), /* Some misc. default paths */ F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), diff --git a/ircd/m_join.c b/ircd/m_join.c index 7391139..469fbd8 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -367,7 +367,6 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) for (name = ircd_strtok(&p, chanlist, ","); name; name = ircd_strtok(&p, 0, ",")) { - clean_channelname(name); if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */ continue; diff --git a/ircd/m_names.c b/ircd/m_names.c index a4627a3..6c74178 100644 --- a/ircd/m_names.c +++ b/ircd/m_names.c @@ -469,7 +469,6 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * (As performed with each /join) - ** High frequency usage ** */ - clean_channelname(para); chptr = FindChannel(para); if (chptr) {