diff options
author | Timo Sirainen <cras@irssi.org> | 2001-08-14 13:19:06 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-08-14 13:19:06 +0000 |
commit | 0d5e56919531ec2de74e0333b7f38ec87d3a4b07 (patch) | |
tree | 20eb8d425e965f725ef5abef2ecc6b03858d9d5a /src/fe-common/core | |
parent | 295d16536e11811f8290dbee57f8cb537296db07 (diff) | |
download | irssi-0d5e56919531ec2de74e0333b7f38ec87d3a4b07.zip |
Some internal changes how /SERVER command works. Added /SERVER PURGE
[<target>] command. The channel output is purged at /PART if the output
queue is larger than 10.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1759 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/fe-server.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index 025c77d7..b50efd0a 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -189,36 +189,30 @@ static void cmd_server_remove(const char *data) cmd_params_free(free_arg); } -static void cmd_server(const char *data, SERVER_REC *server, void *item) +static void cmd_server(const char *data) { - GHashTable *optlist; - char *addr; - void *free_arg; - - if (*data == '\0') { - if (servers == NULL && lookup_servers == NULL && - reconnects == NULL) { - printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, - TXT_NO_CONNECTED_SERVERS); - } else { - print_servers(); - print_lookup_servers(); - print_reconnects(); - } - - signal_stop(); + if (*data != '\0') return; - } - if (g_strncasecmp(data, "add ", 4) == 0 || - g_strncasecmp(data, "remove ", 7) == 0 || - g_strcasecmp(data, "list") == 0 || - g_strncasecmp(data, "list ", 5) == 0) { - command_runsub("server", data, server, item); - signal_stop(); - return; + if (servers == NULL && lookup_servers == NULL && + reconnects == NULL) { + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + TXT_NO_CONNECTED_SERVERS); + } else { + print_servers(); + print_lookup_servers(); + print_reconnects(); } + signal_stop(); +} + +static void cmd_server_connect(const char *data) +{ + GHashTable *optlist; + char *addr; + void *free_arg; + if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS, "connect", &optlist, &addr)) return; @@ -324,6 +318,7 @@ static void sig_chat_protocol_unknown(const char *protocol) void fe_server_init(void) { command_bind("server", NULL, (SIGNAL_FUNC) cmd_server); + command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect); 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", "4 6 auto noauto -host -port"); @@ -345,6 +340,7 @@ void fe_server_init(void) void fe_server_deinit(void) { command_unbind("server", (SIGNAL_FUNC) cmd_server); + command_unbind("server connect", (SIGNAL_FUNC) cmd_server_connect); command_unbind("server add", (SIGNAL_FUNC) cmd_server_add); command_unbind("server remove", (SIGNAL_FUNC) cmd_server_remove); |