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/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/core')
-rw-r--r-- | src/core/chat-commands.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index 02ce45bf..6ddd2f1a 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -175,9 +175,20 @@ static void update_reconnection(SERVER_CONNECT_REC *conn, SERVER_REC *server) } } +static void cmd_server(const char *data, SERVER_REC *server, WI_ITEM_REC *item) +{ + command_runsub("server", data, server, item); +} + +static void sig_default_command_server(const char *data, SERVER_REC *server, + WI_ITEM_REC *item) +{ + signal_emit("command server connect", 3, data, server, item); +} + /* SYNTAX: SERVER [-4 | -6] [-ircnet <ircnet>] [-host <hostname>] [+]<address>|<chatnet> [<port> [<password> [<nick>]]] */ -static void cmd_server(const char *data, SERVER_REC *server) +static void cmd_server_connect(const char *data, SERVER_REC *server) { SERVER_CONNECT_REC *conn; int plus_addr; @@ -366,6 +377,7 @@ void chat_commands_init(void) settings_add_str("misc", "quit_message", "leaving"); command_bind("server", NULL, (SIGNAL_FUNC) cmd_server); + command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect); command_bind("connect", NULL, (SIGNAL_FUNC) cmd_connect); command_bind("disconnect", NULL, (SIGNAL_FUNC) cmd_disconnect); command_bind("quit", NULL, (SIGNAL_FUNC) cmd_quit); @@ -376,6 +388,8 @@ void chat_commands_init(void) command_bind("foreach channel", NULL, (SIGNAL_FUNC) cmd_foreach_channel); command_bind("foreach query", NULL, (SIGNAL_FUNC) cmd_foreach_query); + signal_add("default command server", (SIGNAL_FUNC) sig_default_command_server); + command_set_options("connect", "4 6 +host"); command_set_options("join", "invite"); } @@ -383,6 +397,7 @@ void chat_commands_init(void) void chat_commands_deinit(void) { command_unbind("server", (SIGNAL_FUNC) cmd_server); + command_unbind("server connect", (SIGNAL_FUNC) cmd_server_connect); command_unbind("connect", (SIGNAL_FUNC) cmd_connect); command_unbind("disconnect", (SIGNAL_FUNC) cmd_disconnect); command_unbind("quit", (SIGNAL_FUNC) cmd_quit); @@ -392,4 +407,6 @@ void chat_commands_deinit(void) command_unbind("foreach server", (SIGNAL_FUNC) cmd_foreach_server); command_unbind("foreach channel", (SIGNAL_FUNC) cmd_foreach_channel); command_unbind("foreach query", (SIGNAL_FUNC) cmd_foreach_query); + + signal_remove("default command server", (SIGNAL_FUNC) sig_default_command_server); } |