Commits

Anonymous committed 3da2876

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

Comments (0)

Files changed (7)

 
 channel {
 	autochanmodes = "nt";
+	admin_on_channel_create = no;
 	exemptchanops = "NT";
 	use_halfop = yes;
 	use_admin = yes;

doc/reference.conf

 	 */
 	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.
 {
 	char * autochanmodes;
 	char * exemptchanops;
+	int admin_on_channel_create;
 	int use_halfop;
 	int use_admin;
 	int use_except;
 		"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,
 		&ConfigChannel.use_halfop,
 				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) >=
 	{ "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		},
 
 	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;