From: Jochen Meesters Date: Sun, 22 Jun 2003 13:42:40 +0000 (+0000) Subject: Author: beware X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=70285da6e6bf7c33e980f2b135613e84c84d1803 Author: beware Log message: This adds FEAT_LOCAL_CHANNELS, which causes "CHANTYPES" isupport token to be "#&" or "#", and allows/disallows creation of &channels. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@953 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 4abcfb4..83d8e9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-06-22 Bas Steendijk + + * include/ircd_features.h, include/supported.h, ircd/ircd_features.c, + ircd/ircd_features.c, ircu2.10/ircd/m_join.c, doc/example.conf: + Make ability to create local channels a feature which can be disabled. + 2003-06-22 Bas Steendijk * include/ircd_features.h, ircd/channel.c, ircd/ircd_features.c, diff --git a/doc/example.conf b/doc/example.conf index a35f8d9..8212254 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -762,6 +762,7 @@ features # "LOCOP_WIDE_GLINE" = "FALSE"; # "LOCOP_LIST_CHAN" = "FALSE"; # "OPLEVELS" = "TRUE"; +# "LOCAL_CHANNELS" = "TRUE"; }; # Well, you have now reached the end of this sample configuration diff --git a/include/ircd_features.h b/include/ircd_features.h index 024d458..429ff10 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -50,6 +50,7 @@ enum Feature { FEAT_AUTOHIDE, FEAT_CONNEXIT_NOTICES, FEAT_OPLEVELS, + FEAT_LOCAL_CHANNELS, /* features that probably should not be touched */ FEAT_KILLCHASETIMELIMIT, diff --git a/include/supported.h b/include/supported.h index 23eee85..650cfda 100644 --- a/include/supported.h +++ b/include/supported.h @@ -58,7 +58,7 @@ feature_int(FEAT_MAXBANS), NICKLEN, TOPICLEN, \ AWAYLEN, TOPICLEN -#define FEATURESVALUES2 "#&", "(ov)@+", "b,k,l,imnpstr", "rfc1459", \ +#define FEATURESVALUES2 feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(ov)@+", "b,k,l,imnpstr", "rfc1459", \ feature_str(FEAT_NETWORK) #endif /* INCLUDED_supported_h */ diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index 507e811..45f6ab6 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -256,6 +256,7 @@ static struct FeatureDesc { F_B(AUTOHIDE, 0, 1, 0), F_B(CONNEXIT_NOTICES, 0, 0, 0), F_B(OPLEVELS, 0, 1, 0), + F_B(LOCAL_CHANNELS, 0, 1, 0), /* features that probably should not be touched */ F_I(KILLCHASETIMELIMIT, 0, 30, 0), diff --git a/ircd/m_join.c b/ircd/m_join.c index d2bfcfe..143a090 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -229,6 +229,12 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) else flags = CHFL_CHANOP; + /* disallow creating local channels */ + if ((name[0] == '&') && !chptr && !feature_bool(FEAT_LOCAL_CHANNELS)) { + send_reply(sptr, ERR_NOSUCHCHANNEL, name); + continue; + } + if (cli_user(sptr)->joined >= feature_int(FEAT_MAXCHANNELSPERUSER) && !HasPriv(sptr, PRIV_CHAN_LIMIT)) { send_reply(sptr, ERR_TOOMANYCHANNELS, chptr ? chptr->chname : name);