From 837a020a0ce9c54049480aa1b7195a0266ff457f Mon Sep 17 00:00:00 2001 From: "B.Greenham" Date: Tue, 23 Feb 2010 22:38:35 -0500 Subject: [PATCH] Add general::secret_channels_in_whois. --- doc/example.conf | 1 + doc/reference.conf | 6 ++++++ include/s_conf.h | 1 + modules/m_info.c | 6 ++++++ modules/m_whois.c | 6 +++++- src/newconf.c | 1 + src/s_conf.c | 1 + 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/example.conf b/doc/example.conf index 61ba5fb..0a3357f 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -468,6 +468,7 @@ general { map_oper_only = no; operspy_admin_only = no; operspy_dont_care_user_info = no; + secret_channels_in_whois = no; caller_id_wait = 1 minute; pace_wait_simple = 1 second; pace_wait = 10 seconds; diff --git a/doc/reference.conf b/doc/reference.conf index eea16c2..915f96d 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -1100,6 +1100,12 @@ general { * protected. */ operspy_dont_care_user_info = no; + /* secret channels in whois: display secret channels in /whois + * even if operspy was not used, as long as the oper doing the + * whois has the oper:spy priv. this will not send any kind of + * server notice. */ + secret_channels_in_whois = no; + /* caller id wait: time between notifying a +g user that somebody * is messaging them. */ diff --git a/include/s_conf.h b/include/s_conf.h index 69a80b5..625bfde 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -216,6 +216,7 @@ struct config_file_entry int default_umodes; int global_snotices; int operspy_dont_care_user_info; + int secret_channels_in_whois; }; struct config_channel_entry diff --git a/modules/m_info.c b/modules/m_info.c index 49c8512..746ae41 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -356,6 +356,12 @@ static struct InfoStruct info_table[] = { &ConfigFileEntry.operspy_dont_care_user_info, "Remove accountability and some '!' requirement from non-channel operspy" }, + { + "secret_channels_in_whois", + OUTPUT_BOOLEAN, + &ConfigFileEntry.secret_channels_in_whois, + "Defines whether secret channels are always shown in whois to opers with oper:spy priv." + }, { "pace_wait", OUTPUT_DECIMAL, diff --git a/modules/m_whois.c b/modules/m_whois.c index b37a4da..8ce505c 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -242,6 +242,10 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) int extra_space = 0; int i; char *m; + int showsecret = 0; + + if(ConfigFileEntry.secret_channels_in_whois && IsOperSpy(source_p)) + showsecret = 1; if(target_p->user == NULL) { @@ -281,7 +285,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) visible = ShowChannel(source_p, chptr); - if(visible || operspy) + if(visible || operspy || showsecret) { if((cur_len + strlen(chptr->chname) + 3) > (BUFSIZE - 5)) { diff --git a/src/newconf.c b/src/newconf.c index 2701306..168de2d 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2177,6 +2177,7 @@ static struct ConfEntry conf_general_table[] = { "no_oper_flood", CF_YESNO, NULL, 0, &ConfigFileEntry.no_oper_flood }, { "operspy_admin_only", CF_YESNO, NULL, 0, &ConfigFileEntry.operspy_admin_only }, { "operspy_dont_care_user_info", CF_YESNO, NULL, 0, &ConfigFileEntry.operspy_dont_care_user_info }, + { "secret_channels_in_whois", CF_YESNO, NULL, 0, &ConfigFileEntry.secret_channels_in_whois }, { "pace_wait", CF_TIME, NULL, 0, &ConfigFileEntry.pace_wait }, { "pace_wait_simple", CF_TIME, NULL, 0, &ConfigFileEntry.pace_wait_simple }, { "ping_cookie", CF_YESNO, NULL, 0, &ConfigFileEntry.ping_cookie }, diff --git a/src/s_conf.c b/src/s_conf.c index 2257fb1..dcdd30d 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -735,6 +735,7 @@ set_default_conf(void) ConfigFileEntry.collision_fnc = YES; ConfigFileEntry.global_snotices = YES; ConfigFileEntry.operspy_dont_care_user_info = NO; + ConfigFileEntry.secret_channels_in_whois = NO; #ifdef HAVE_LIBZ ConfigFileEntry.compression_level = 4;