Add channel::admin_on_channel_create, which gives users creating new channels +ao instead of +o, if enabled.

This commit is contained in:
B.Greenham 2010-07-29 14:22:33 -04:00
parent 7af1b8d223
commit d7a3d23cdd
7 changed files with 19 additions and 1 deletions

View File

@ -377,6 +377,7 @@ exempt {
channel {
autochanmodes = "nt";
admin_on_channel_create = no;
exemptchanops = "NT";
use_halfop = yes;
use_admin = yes;

View File

@ -770,6 +770,11 @@ channel {
*/
autochanmodes = "nt";
/* admin_on_channel_create: If set to yes, users joining new channels
* will be given +ao instead of just +o. Requires use_admin.
*/
admin_on_channel_create = no;
/* exemptchanops: Channel modes that any form of channel ops (+aoh)
* will be exempt from. Even if the mode is set, it will not apply to the
* channel ops if it is listed in this option. Valid modes are cCDTNGK.

View File

@ -239,6 +239,7 @@ struct config_channel_entry
{
char * autochanmodes;
char * exemptchanops;
int admin_on_channel_create;
int use_halfop;
int use_admin;
int use_except;

View File

@ -625,6 +625,12 @@ static struct InfoStruct info_table[] = {
&ConfigChannel.host_in_topic,
"Defines whether a topicsetters host or just nick is shown on TOPIC",
},
{
"admin_on_channel_create",
OUTPUT_BOOLEAN_YN,
&ConfigChannel.admin_on_channel_create,
"Give users +ao on channel create",
},
{
"use_halfop",
OUTPUT_BOOLEAN_YN,

View File

@ -1873,7 +1873,10 @@ void user_join(struct Client * client_p, struct Client * source_p, const char *
continue;
}
flags = CHFL_CHANOP;
if(ConfigChannel.admin_on_channel_create)
flags = CHFL_ADMIN | CHFL_CHANOP;
else
flags = CHFL_CHANOP;
}
if((rb_dlink_list_length(&source_p->user->channel) >=

View File

@ -2279,6 +2279,7 @@ static struct ConfEntry conf_channel_table[] =
{ "only_ascii_channels", CF_YESNO, NULL, 0, &ConfigChannel.only_ascii_channels },
{ "cycle_host_change", CF_YESNO, NULL, 0, &ConfigChannel.cycle_host_change },
{ "host_in_topic", CF_YESNO, NULL, 0, &ConfigChannel.host_in_topic },
{ "admin_on_channel_create", CF_YESNO, NULL, 0, &ConfigChannel.admin_on_channel_create },
{ "use_halfop", CF_YESNO, NULL, 0, &ConfigChannel.use_halfop },
{ "use_admin", CF_YESNO, NULL, 0, &ConfigChannel.use_admin },
{ "use_except", CF_YESNO, NULL, 0, &ConfigChannel.use_except },

View File

@ -764,6 +764,7 @@ set_default_conf(void)
ConfigChannel.autochanmodes = rb_strdup("nt");
ConfigChannel.exemptchanops = rb_strdup("");
ConfigChannel.admin_on_channel_create = NO;
ConfigChannel.use_halfop = YES;
ConfigChannel.use_admin = YES;
ConfigChannel.use_except = YES;