jdhore avatar jdhore committed 74b0dcc

Add general::hide_channel_below_users option.
This allows server owners to set how many users must be in a channel before
/LIST will show it.

Comments (0)

Files changed (6)

 	#static_quit = "I like turtles!";
 	servicestring = "is a Network Service";
 	disable_fake_channels = no;
+	hide_channel_below_users = 3;
         tkline_expire_notices = no;
         default_floodcount = 10;
 	failed_oper_notice = yes;

doc/reference.conf

 	 */
 	disable_fake_channels = no;
 
+	/* hide_channel_below_users: Amount of users a channel must have in it
+	 * before it is shown in a standard LIST. This can be overridden by
+	 * invoking LIST like: /LIST <3
+	 */
+	hide_channel_below_users = 3;
+
         /* tkline_expire_notices: give a notice to opers when a tkline
          * expires
          */
 
 	unsigned char compression_level;
 	int disable_fake_channels;
+	int hide_channel_below_users;
 	int dots_in_ident;
 	int failed_oper_notice;
 	int anti_nick_flood;
 		return 0;
 	}
 
-	/* XXX rather arbitrary -- jilles */
-	params.users_min = 3;
+	/* Let the user set it */
+	params.users_min = ConfigFileEntry.hide_channel_below_users;
 	params.users_max = INT_MAX;
 
 	if (parc > 1 && parv[1] != NULL && !IsChannelName(parv[1]))
 	{ "anti_spam_exit_message_time", CF_TIME,  NULL, 0, &ConfigFileEntry.anti_spam_exit_message_time },
 	{ "use_part_messages",		CF_YESNO, NULL, 0, &ConfigFileEntry.use_part_messages	},
 	{ "disable_fake_channels",	 CF_YESNO, NULL, 0, &ConfigFileEntry.disable_fake_channels },
+	{ "hide_channel_below_users", CF_INT, NULL, 0, &ConfigFileEntry.hide_channel_below_users },
 	{ "min_nonwildcard_simple",	 CF_INT,   NULL, 0, &ConfigFileEntry.min_nonwildcard_simple },
 	{ "non_redundant_klines",	 CF_YESNO, NULL, 0, &ConfigFileEntry.non_redundant_klines },
 	{ "tkline_expire_notices",	 CF_YESNO, NULL, 0, &ConfigFileEntry.tkline_expire_notices },
 	ConfigFileEntry.failed_oper_notice = YES;
 	ConfigFileEntry.anti_nick_flood = NO;
 	ConfigFileEntry.disable_fake_channels = NO;
+	ConfigFileEntry.hide_channel_below_users = 3;
 	ConfigFileEntry.max_nick_time = 20;
 	ConfigFileEntry.max_nick_changes = 5;
 	ConfigFileEntry.max_accept = 20;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.