From b3dc35545de9aedd90d992fd8c1baed3a33c4232 Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 7 Feb 2012 14:19:36 +0100 Subject: [PATCH] added revoke_mode_a setting --- src/chanserv.c | 17 ++++++++++++----- srvx.conf.example | 48 ++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/chanserv.c b/src/chanserv.c index 7512279..e06cf46 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -58,6 +58,7 @@ #define KEY_MAX_USERINFO_LENGTH "max_userinfo_length" #define KEY_GIVEOWNERSHIP_PERIOD "giveownership_timeout" #define KEY_INVITED_INTERVAL "invite_timeout" +#define KEY_REVOKE_MODE_A "revoke_mode_a" #define KEY_NEW_CHANNEL_AUTHED "new_channel_authed_join" #define KEY_NEW_CHANNEL_UNAUTHED "new_channel_unauthed_join" #define KEY_NEW_CHANNEL_MSG "new_channel_message" @@ -568,6 +569,8 @@ static struct unsigned int max_chan_users; unsigned int max_chan_bans; unsigned int max_userinfo_length; + + unsigned int revoke_mode_a; struct string_list *set_shows; struct string_list *eightball; @@ -1438,11 +1441,13 @@ unregister_channel(struct chanData *channel, const char *reason) timeq_del(0, NULL, channel, TIMEQ_IGNORE_FUNC | TIMEQ_IGNORE_WHEN); - if(off_channel > 0) - { - mod_chanmode_init(&change); - change.modes_clear |= MODE_REGISTERED; - mod_chanmode_announce(chanserv, channel->channel, &change); + if(off_channel > 0 || chanserv_conf.revoke_mode_a) { + mod_chanmode_init(&change); + if(off_channel > 0) + change.modes_clear |= MODE_REGISTERED; + if(chanserv_conf.revoke_mode_a) + change.modes_clear |= MODE_ACCESS; + mod_chanmode_announce(chanserv, channel->channel, &change); } while(channel->users) @@ -7659,6 +7664,8 @@ chanserv_conf_read(void) chanserv_conf.dnr_expire_frequency = str ? ParseInterval(str) : 3600; str = database_get_data(conf_node, KEY_INVITED_INTERVAL, RECDB_QSTRING); chanserv_conf.invited_timeout = str ? ParseInterval(str) : 600*2; + str = database_get_data(conf_node, KEY_REVOKE_MODE_A, RECDB_QSTRING); + chanserv_conf.revoke_mode_a = str ? atoi(str) : 1; str = database_get_data(conf_node, KEY_NODELETE_LEVEL, RECDB_QSTRING); chanserv_conf.nodelete_level = str ? atoi(str) : 1; str = database_get_data(conf_node, KEY_MAX_CHAN_USERS, RECDB_QSTRING); diff --git a/srvx.conf.example b/srvx.conf.example index 3319751..83ffb71 100644 --- a/srvx.conf.example +++ b/srvx.conf.example @@ -43,10 +43,10 @@ "services" { "nickserv" { "nick" "NickServ"; - // What user modes do you want this service to have? Please keep in - // mind which ircd software you are using here, and that all of the - // services need to be at least +o. - // "modes" "+iok"; + // What user modes do you want this service to have? Please keep in + // mind which ircd software you are using here, and that all of the + // services need to be at least +o. + // "modes" "+iok"; // If you want to by have *@* as the default hostmask for all // new accounts, set default_hostmask. This is discouraged // for security reasons. @@ -103,7 +103,7 @@ "uc_H" "800"; // .. and upper case H "S" "999"; "b" "800"; - "I" "800"; + "I" "800"; }; // and for who can change epithets for staff "set_epithet_level" "800"; @@ -143,10 +143,10 @@ "opserv" { "nick" "OpServ"; - // What user modes do you want this service to have? Please keep in - // mind which ircd software you are using here, and that all of the - // services need to be at least +o. - // "modes" "+iok"; + // What user modes do you want this service to have? Please keep in + // mind which ircd software you are using here, and that all of the + // services need to be at least +o. + // "modes" "+iok"; // should use of this service be limited to global opers? "privileged" "1"; // fullname for service @@ -200,19 +200,21 @@ // (This is changed relative srvx-1.0.x, which would use default // unless you specified ".disabled".) "nick" "ChanServ"; - // What user modes do you want this service to have? Please keep in - // mind which ircd software you are using here, and that all of the - // services need to be at least +o. - // "modes" "+iok"; + // What user modes do you want this service to have? Please keep in + // 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? Does it have - // a registered channel mode? Does it support services opping themselves? + // 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 + // 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"; + // revoke channel mode +a on unregister? + "revoke_mode_a" "1"; // how long should a person be unseen before resending infoline? "info_delay" "120"; // maximum greeting length @@ -270,10 +272,10 @@ "global" { "nick" "Global"; - // What user modes do you want this service to have? Please keep in - // mind which ircd software you are using here, and that all of the - // services need to be at least +o. - // "modes" "+iok"; + // What user modes do you want this service to have? Please keep in + // mind which ircd software you are using here, and that all of the + // services need to be at least +o. + // "modes" "+iok"; // should users get community announcements by default or not? "announcements_default" "on"; }; -- 2.20.1