]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add general::hide_channel_below_users option.
authorJD Horelick <redacted>
Sat, 10 Jul 2010 05:28:21 +0000 (01:28 -0400)
committerJD Horelick <redacted>
Sat, 10 Jul 2010 05:28:21 +0000 (01:28 -0400)
This allows server owners to set how many users must be in a channel before
/LIST will show it.

doc/example.conf
doc/reference.conf
include/s_conf.h
modules/m_list.c
src/newconf.c
src/s_conf.c

index 0f08301f87cf428372769dec7726d639f6ed47c5..f730b8388ed30e5a2441495de0cae3f6aa9dca4d 100755 (executable)
@@ -519,6 +519,7 @@ general {
        #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;
index f77e60c736f2a397dacccba884b1a81920ef8c66..0c21b389db3344bee83b4408affe2f96bf976a9c 100755 (executable)
@@ -1108,6 +1108,12 @@ general {
         */
        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
          */
index ebe88f1fe02a559f82ce8fe848712bff763ed061..ec3a222baba7d471b15d2020c8a10404949c1c15 100644 (file)
@@ -166,6 +166,7 @@ struct config_file_entry
 
        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;
index ec2656d24429314b4859f8f38b1dcba0c8b38433..91a16787c6c2a4a16aaaccd9faffb945c16e8b15 100644 (file)
@@ -152,8 +152,8 @@ static int mo_list(struct Client *client_p, struct Client *source_p, int parc, c
                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]))
index 8eeca1e5e0997b9831280b79f9431b9cc087123d..df662d8db912be75bb994e971c85dd962f9d2730 100644 (file)
@@ -2201,6 +2201,7 @@ static struct ConfEntry conf_general_table[] =
        { "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 },
index 1cf0c269db70073a27ac618b7bfc7362ccf4e017..f54dc8032cb4073feb6c253565f171c7a6cffb3d 100644 (file)
@@ -698,6 +698,7 @@ set_default_conf(void)
        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;