From e80daf745692b517c7d09161b70dd31c1586277a Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 15 Sep 2004 04:14:14 +0000 Subject: [PATCH] Consolidate use_registered_mode into off_channel and expand overall functionality * srvx.conf's off_channel setting now allows us to turn on all of the features of out-of-channel services without activating the channel setting to have chanserv part git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-81 --- ChangeLog | 17 +++++++++++++++++ src/chanserv.c | 16 ++++++---------- srvx.conf.example | 15 +++++++++------ 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22113d3..0d9f114 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,23 @@ # arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3 # +2004-09-15 04:14:14 GMT adam patch-81 + + Summary: + Consolidate use_registered_mode into off_channel and expand overall functionality + Revision: + srvx--devo--1.3--patch-81 + + * srvx.conf's off_channel setting now allows us to turn on all of the features of out-of-channel services without activating the + channel setting to have chanserv part + + + + + modified files: + ChangeLog src/chanserv.c srvx.conf.example + + 2004-09-13 13:11:38 GMT Michael Poole patch-80 Summary: diff --git a/src/chanserv.c b/src/chanserv.c index 61eba38..abba31f 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -502,8 +502,6 @@ static struct unsigned int max_chan_bans; unsigned int max_userinfo_length; - unsigned int use_registered_mode; - struct string_list *set_shows; struct string_list *eightball; struct string_list *old_ban_names; @@ -1292,7 +1290,7 @@ unregister_channel(struct chanData *channel, const char *reason) timeq_del(0, NULL, channel, TIMEQ_IGNORE_FUNC | TIMEQ_IGNORE_WHEN); - if(chanserv_conf.use_registered_mode) + if(off_channel > 0) { mod_chanmode_init(&change); change.modes_clear |= MODE_REGISTERED; @@ -1753,7 +1751,7 @@ static CHANSERV_FUNC(cmd_register) cData = register_channel(channel, user->handle_info->handle); scan_user_presence(add_channel_user(cData, handle, UL_OWNER, 0, NULL), NULL); cData->modes = chanserv_conf.default_modes; - if(chanserv_conf.use_registered_mode) + if(off_channel > 0) cData->modes.modes_set |= MODE_REGISTERED; change = mod_chanmode_dup(&cData->modes, 1); change->args[change->argc].mode = MODE_CHANOP; @@ -1913,7 +1911,7 @@ static CHANSERV_FUNC(cmd_move) mod_chanmode_announce(chanserv, target, &change); } - if(chanserv_conf.use_registered_mode) + if(off_channel > 0) { /* Clear MODE_REGISTERED from old channel, add it to new. */ change.argc = 0; @@ -6468,9 +6466,7 @@ chanserv_conf_read(void) /* the variable itself is actually declared in proto-common.c; this is equally * parse issue. */ str = database_get_data(conf_node, "off_channel", RECDB_QSTRING); - off_channel = (str && enabled_string(str)) ? 1 : 0; - str = database_get_data(conf_node, "use_registered_mode", RECDB_QSTRING); - chanserv_conf.use_registered_mode = (str && enabled_string(str)) ? 1 : 0; + off_channel = str ? atoi(str) : 0; } static void @@ -6780,7 +6776,7 @@ chanserv_channel_read(const char *key, struct record_data *hir) && (argc = split_line(str, 0, ArrayLength(argv), argv)) && (modes = mod_chanmode_parse(cNode, argv, argc, MCP_KEY_FREE))) { cData->modes = *modes; - if(chanserv_conf.use_registered_mode) + if(off_channel > 0) cData->modes.modes_set |= MODE_REGISTERED; if(cData->modes.argc > 1) cData->modes.argc = 1; @@ -7264,7 +7260,7 @@ init_chanserv(const char *nick) DEFINE_CHANNEL_OPTION(ctcpusers); DEFINE_CHANNEL_OPTION(ctcpreaction); DEFINE_CHANNEL_OPTION(inviteme); - if(off_channel) + if(off_channel > 1) DEFINE_CHANNEL_OPTION(offchannel); modcmd_register(chanserv_module, "set defaults", chan_opt_defaults, 1, 0, "access", "owner", NULL); diff --git a/srvx.conf.example b/srvx.conf.example index 8145b1f..fa446b2 100644 --- a/srvx.conf.example +++ b/srvx.conf.example @@ -191,12 +191,15 @@ // mind which ircd software you are using here, and that all of the // services need to be at least +o. // "modes" "+iok"; - // Does your ircd have off-channel services support? - // Bahamut does; ircu2.10.11 does not. - "off_channel" "off"; - // Does your ircd have a mode for registered channels? - // Bahamut does; ircu2.10.11 does not. - "use_registered_mode" "off"; + // Does your ircd have off-channel services support? Does it have + // a registered channel mode? Does it support services opping themselves? + // Bahamut has these things; ircu2.10.11 does not. + // This setting takes three numerical values: + // 0 = off + // 1 = use a registered channel mode, have services op themselves + // 2 = all of the above, and a channel setting to have ChanServ not + // idle in the channel + "off_channel" "0"; // how long should a person be unseen before resending infoline? "info_delay" "120"; // maximum greeting length -- 2.20.1