From 46f0c5186306d7780b956b0f6bae1d9dfc8cbb1c Mon Sep 17 00:00:00 2001 From: "B.Greenham" Date: Sat, 27 Feb 2010 20:05:07 -0500 Subject: [PATCH] Add config options for owner and halfop. --- doc/example.conf | 2 ++ doc/reference.conf | 8 ++++++++ help/opers/cmode | 6 +++++- include/s_conf.h | 2 ++ modules/m_info.c | 12 ++++++++++++ src/newconf.c | 2 ++ src/s_conf.c | 2 ++ 7 files changed, 33 insertions(+), 1 deletion(-) diff --git a/doc/example.conf b/doc/example.conf index e38519c..33b9b03 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -327,6 +327,8 @@ exempt { channel { autochanmodes = "nt"; + use_halfop = yes; + use_owner = yes; use_invex = yes; use_except = yes; use_knock = yes; diff --git a/doc/reference.conf b/doc/reference.conf index 34d98da..788a47b 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -678,6 +678,14 @@ channel { */ autochanmodes = "nt"; + /* halfop: Enable/disable channel mode +h, which adds halfop, + * a channel status below op that has op powers (kick, ban, mode, etc.) + use_halfop = yes; + + /* owner: Enable/disable channel mode +a, which adds owner, + * a channel status above op that has op powers (kick, ban, mode, etc.) + use_owner = yes; + /* invex: Enable/disable channel mode +I, a n!u@h list of masks * that can join a +i channel without an invite. */ diff --git a/help/opers/cmode b/help/opers/cmode index d574a97..45da475 100644 --- a/help/opers/cmode +++ b/help/opers/cmode @@ -52,8 +52,12 @@ WITH PARAMETERS: PARAMS: /mode #channel +l limit +v - Voice. Allows a user to talk in a +m channel. Noted by +nick. PARAMS: /mode #channel +v nick - +o - Op. Allows a user full control over the channel. + +h - Halfop. Grants channel half-operator status. + PARAMS: /mode #channel +h nick + +o - Op. Grants channel operator status. PARAMS: /mode #channel +o nick + +a - Owner. Grants channel owner status. + PARAMS: /mode #channel +a nick +b - Ban. Prevents a user from entering the channel, and from sending or changing nick if they are on it, based on a nick!ident@host match. diff --git a/include/s_conf.h b/include/s_conf.h index a78eb25..8a3d3f8 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -222,6 +222,8 @@ struct config_file_entry struct config_channel_entry { char * autochanmodes; + int use_halfop; + int use_owner; int use_except; int use_invex; int use_knock; diff --git a/modules/m_info.c b/modules/m_info.c index fea223c..160fae5 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -572,6 +572,18 @@ static struct InfoStruct info_table[] = { &ConfigChannel.host_in_topic, "Defines whether a topicsetters host or just nick is shown on TOPIC", }, + { + "use_halfop", + OUTPUT_BOOLEAN_YN, + &ConfigChannel.use_halfop, + "Enable chanmode +h (halfop)", + }, + { + "use_owner", + OUTPUT_BOOLEAN_YN, + &ConfigChannel.use_owner, + "Enable chanmode +a (owner)", + }, { "use_except", OUTPUT_BOOLEAN_YN, diff --git a/src/newconf.c b/src/newconf.c index 9488ba5..b849033 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2221,6 +2221,8 @@ 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 }, + { "use_halfop", CF_YESNO, NULL, 0, &ConfigChannel.use_halfop }, + { "use_owner", CF_YESNO, NULL, 0, &ConfigChannel.use_owner }, { "use_except", CF_YESNO, NULL, 0, &ConfigChannel.use_except }, { "use_invex", CF_YESNO, NULL, 0, &ConfigChannel.use_invex }, { "use_knock", CF_YESNO, NULL, 0, &ConfigChannel.use_knock }, diff --git a/src/s_conf.c b/src/s_conf.c index 92deef5..a90b1c6 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -747,6 +747,8 @@ set_default_conf(void) ConfigFileEntry.oper_snomask = SNO_GENERAL; ConfigChannel.autochanmodes = rb_strdup("nt"); + ConfigChannel.use_halfop = YES; + ConfigChannel.use_owner = YES; ConfigChannel.use_except = YES; ConfigChannel.use_invex = YES; ConfigChannel.use_knock = YES;