mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Merge pull request #7 from ailin-nemui/names-limit
add a limit to showing /NAMES on join
This commit is contained in:
commit
471046f5b6
@ -107,9 +107,14 @@ static void signal_window_item_changed(WINDOW_REC *window, WI_ITEM_REC *item)
|
|||||||
|
|
||||||
static void sig_channel_joined(CHANNEL_REC *channel)
|
static void sig_channel_joined(CHANNEL_REC *channel)
|
||||||
{
|
{
|
||||||
if (settings_get_bool("show_names_on_join") &&
|
if (settings_get_bool("show_names_on_join") && !channel->session_rejoin) {
|
||||||
!channel->session_rejoin)
|
int limit = settings_get_int("show_names_on_join_limit");
|
||||||
fe_channels_nicklist(channel, CHANNEL_NICKLIST_FLAG_ALL);
|
int flags = CHANNEL_NICKLIST_FLAG_ALL;
|
||||||
|
if (limit > 0 && g_hash_table_size(channel->nicks) > limit) {
|
||||||
|
flags |= CHANNEL_NICKLIST_FLAG_COUNT;
|
||||||
|
}
|
||||||
|
fe_channels_nicklist(channel, flags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYNTAX: JOIN [-window] [-invite] [-<server tag>] <channels> [<keys>] */
|
/* SYNTAX: JOIN [-window] [-invite] [-<server tag>] <channels> [<keys>] */
|
||||||
@ -625,6 +630,7 @@ void fe_channels_init(void)
|
|||||||
{
|
{
|
||||||
settings_add_bool("lookandfeel", "autoclose_windows", TRUE);
|
settings_add_bool("lookandfeel", "autoclose_windows", TRUE);
|
||||||
settings_add_bool("lookandfeel", "show_names_on_join", TRUE);
|
settings_add_bool("lookandfeel", "show_names_on_join", TRUE);
|
||||||
|
settings_add_int("lookandfeel", "show_names_on_join_limit", 18);
|
||||||
settings_add_int("lookandfeel", "names_max_columns", 6);
|
settings_add_int("lookandfeel", "names_max_columns", 6);
|
||||||
settings_add_int("lookandfeel", "names_max_width", 0);
|
settings_add_int("lookandfeel", "names_max_width", 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user