]> jfr.im git - solanum.git/commitdiff
LIST: allow channel display threshold to be configured (closes #109)
authorWilliam Pitcock <redacted>
Sun, 27 Dec 2015 04:23:28 +0000 (22:23 -0600)
committerWilliam Pitcock <redacted>
Sun, 27 Dec 2015 04:23:28 +0000 (22:23 -0600)
doc/ircd.conf.example
doc/reference.conf
include/s_conf.h
modules/m_list.c
src/newconf.c
src/s_conf.c

index 10c6517bf7f299a9592219adbe0eb109cb7e4508..f42449a52894784f35247b3f358c1f3a1e937df6 100755 (executable)
@@ -362,6 +362,7 @@ channel {
        channel_target_change = yes;
        disable_local_channels = no;
        autochanmodes = "+nt";
+       displayed_usercount = 3;
 };
 
 serverhide {
index 6c3806e4b892e6428dcacc8aee680e7f6a597008..d6ef7f0a64eddf404af67b0e7920fed05bb03789 100755 (executable)
@@ -802,6 +802,12 @@ channel {
         * when a channel is created.
         */
        autochanmodes = "+nt";
+
+       /* displayed_usercount: the minimum amount of users on a channel before it
+        * is displayed in LIST.  this parameter can be overridden using ELIST parameters,
+        * such as LIST >0.
+        */
+       displayed_usercount = 3;
 };
 
 
index 9d7c77035d9e4860b778a8207e57ebe5732fc071..42e267051805f5ee23d27b8e04cf9cb0b2033d70 100644 (file)
@@ -259,6 +259,7 @@ struct config_channel_entry
        int channel_target_change;
        int disable_local_channels;
        unsigned int autochanmodes;
+       int displayed_usercount;
 };
 
 struct config_server_hide
index 246a8de7869a857df4d85486df0c1376efaee441..9e90260a04dc5b2704f0a8a790818b337c2298d5 100644 (file)
@@ -197,7 +197,7 @@ static int mo_list(struct Client *client_p, struct Client *source_p, int parc, c
        params = rb_malloc(sizeof(struct ListClient));
 
        /* XXX rather arbitrary -- jilles */
-       params->users_min = 3;
+       params->users_min = ConfigChannel.displayed_usercount;
        params->users_max = INT_MAX;
        params->operspy = operspy;
        params->created_min = params->topic_min =
index a3e12272037551dfbdc759100ea6d9133a8ea03d..717cfcf44d9e83f421538af5c921230bbcedc228 100644 (file)
@@ -2458,6 +2458,7 @@ static struct ConfEntry conf_channel_table[] =
        { "channel_target_change", CF_YESNO, NULL, 0, &ConfigChannel.channel_target_change      },
        { "disable_local_channels", CF_YESNO, NULL, 0, &ConfigChannel.disable_local_channels },
        { "autochanmodes",      CF_QSTRING, conf_set_channel_autochanmodes, 0, NULL     },
+       { "displayed_usercount",        CF_INT, NULL, 0, &ConfigChannel.displayed_usercount     },
        { "\0",                 0,        NULL, 0, NULL }
 };
 
index 66960a3fa71a8b00ab0ffb788bb4275fd8cb9c09..d6da365d82d0eea0d8eb716f76bcacb7a5031d3f 100644 (file)
@@ -792,6 +792,7 @@ set_default_conf(void)
        ConfigChannel.resv_forcepart = YES;
        ConfigChannel.channel_target_change = YES;
        ConfigChannel.disable_local_channels = NO;
+       ConfigChannel.displayed_usercount = 3;
 
        ConfigChannel.autochanmodes = MODE_TOPICLIMIT | MODE_NOPRIVMSGS;