LIST: allow channel display threshold to be configured (closes #109)

This commit is contained in:
William Pitcock 2015-12-26 22:23:28 -06:00
parent e124e4b64c
commit d513218a9e
6 changed files with 11 additions and 1 deletions

View file

@ -362,6 +362,7 @@ channel {
channel_target_change = yes;
disable_local_channels = no;
autochanmodes = "+nt";
displayed_usercount = 3;
};
serverhide {

View file

@ -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;
};

View 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

View 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 =

View 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 }
};

View 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;