-querychans option for servers and ircnets which specifies how many

channels to query in one line with MODE/WHO commands after joined to a
number of channels. Default is 10 which works usually, with some very
stupid servers (just found one) this has to be set to 1 however.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@981 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-12-09 19:12:49 +00:00 committed by cras
commit 8d98e80a6b
10 changed files with 41 additions and 12 deletions

View file

@ -289,7 +289,7 @@ void fe_server_init(void)
command_bind("server", NULL, (SIGNAL_FUNC) cmd_server);
command_bind("server add", NULL, (SIGNAL_FUNC) cmd_server_add);
command_bind("server remove", NULL, (SIGNAL_FUNC) cmd_server_remove);
command_set_options("server add", "auto noauto -host -cmdspeed -cmdmax -port");
command_set_options("server add", "auto noauto -host -port");
signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting);

View file

@ -63,6 +63,8 @@ static void sig_server_add_fill(IRC_SERVER_SETUP_REC *rec,
if (value != NULL && *value != '\0') rec->cmd_queue_speed = atoi(value);
value = g_hash_table_lookup(optlist, "cmdmax");
if (value != NULL && *value != '\0') rec->max_cmds_at_once = atoi(value);
value = g_hash_table_lookup(optlist, "querychans");
if (value != NULL && *value != '\0') rec->max_query_chans = atoi(value);
}
/* SYNTAX: SERVER LIST */
@ -88,6 +90,8 @@ static void cmd_server_list(const char *data)
g_string_sprintfa(str, "cmdmax: %d, ", rec->max_cmds_at_once);
if (rec->cmd_queue_speed > 0)
g_string_sprintfa(str, "cmdspeed: %d, ", rec->cmd_queue_speed);
if (rec->max_query_chans > 0)
g_string_sprintfa(str, "querychans: %d, ", rec->max_query_chans);
if (rec->own_host != NULL)
g_string_sprintfa(str, "host: %s, ", rec->own_host);
@ -107,7 +111,7 @@ void fe_irc_server_init(void)
signal_add("server add fill", (SIGNAL_FUNC) sig_server_add_fill);
command_bind("server list", NULL, (SIGNAL_FUNC) cmd_server_list);
command_set_options("server add", "-ircnet");
command_set_options("server add", "-ircnet -cmdspeed -cmdmax -querychans");
}
void fe_irc_server_deinit(void)

View file

@ -59,6 +59,8 @@ static void cmd_ircnet_list(void)
g_string_sprintfa(str, "cmdspeed: %d, ", rec->cmd_queue_speed);
if (rec->max_cmds_at_once > 0)
g_string_sprintfa(str, "cmdmax: %d, ", rec->max_cmds_at_once);
if (rec->max_query_chans > 0)
g_string_sprintfa(str, "querychans: %d, ", rec->max_query_chans);
if (rec->max_kicks > 0)
g_string_sprintfa(str, "max_kicks: %d, ", rec->max_kicks);
@ -79,8 +81,9 @@ static void cmd_ircnet_list(void)
/* SYNTAX: IRCNET ADD [-kicks <count>] [-msgs <count>] [-modes <count>]
[-whois <count>] [-cmdspeed <ms>] [-cmdmax <count>]
[-nick <nick>] [-user <user>] [-realname <name>]
[-host <host>] [-autosendcmd <cmd>] <name> */
[-querychans <count>] [-nick <nick>] [-user <user>]
[-realname <name>] [-host <host>] [-autosendcmd <cmd>]
<name> */
static void cmd_ircnet_add(const char *data)
{
GHashTable *optlist;
@ -121,6 +124,8 @@ static void cmd_ircnet_add(const char *data)
if (value != NULL) rec->cmd_queue_speed = atoi(value);
value = g_hash_table_lookup(optlist, "cmdmax");
if (value != NULL) rec->max_cmds_at_once = atoi(value);
value = g_hash_table_lookup(optlist, "querychans");
if (value != NULL) rec->max_query_chans = atoi(value);
value = g_hash_table_lookup(optlist, "nick");
if (value != NULL && *value != '\0') rec->nick = g_strdup(value);
@ -174,7 +179,7 @@ void fe_ircnet_init(void)
command_bind("ircnet add", NULL, (SIGNAL_FUNC) cmd_ircnet_add);
command_bind("ircnet remove", NULL, (SIGNAL_FUNC) cmd_ircnet_remove);
command_set_options("ircnet add", "-kicks -msgs -modes -whois -cmdspeed -cmdmax -nick -user -realname -host -autosendcmd");
command_set_options("ircnet add", "-kicks -msgs -modes -whois -cmdspeed -cmdmax -nick -user -realname -host -autosendcmd -querychans");
}
void fe_ircnet_deinit(void)