From 65c146e9c6dfc050780bad978c582bb659e28396 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 4 Oct 2003 12:15:58 +0000 Subject: Added /rehash and /restart commands --- src/irc/irc-commands.c | 34 ++++++++++++++++++++++++++++++++++ src/irc/irc.h | 2 ++ 2 files changed, 36 insertions(+) (limited to 'src/irc') diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c index f852adf44..00ef9c7b5 100644 --- a/src/irc/irc-commands.c +++ b/src/irc/irc-commands.c @@ -145,6 +145,12 @@ t_irc_command irc_commands[] = N_("data"), N_("data: raw data to send"), 1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL }, + { "rehash", N_("tell the server to reload its config file"), + "", "", + 0, 0, 1, NULL, irc_cmd_send_rehash, NULL }, + { "restart", N_("tell the server to restart itself"), + "", "", + 0, 0, 1, NULL, irc_cmd_send_restart, NULL }, { "topic", N_("get/set channel topic"), N_("[channel] [topic]"), N_("channel: channel name\ntopic: new topic for channel " "(if topic is \"-delete\" then topic is deleted)"), @@ -961,6 +967,34 @@ irc_cmd_send_quote (t_irc_server *server, char *arguments) return 0; } +/* + * irc_cmd_send_rehash: tell the server to reload its config file + */ + +int +irc_cmd_send_rehash (t_irc_server *server, char *arguments) +{ + /* make gcc happy */ + (void) arguments; + + server_sendf (server, "REHASH\r\n"); + return 0; +} + +/* + * irc_cmd_send_restart: tell the server to restart itself + */ + +int +irc_cmd_send_restart (t_irc_server *server, char *arguments) +{ + /* make gcc happy */ + (void) arguments; + + server_sendf (server, "RESTART\r\n"); + return 0; +} + /* * irc_cmd_send_topic: get/set topic for a channel */ diff --git a/src/irc/irc.h b/src/irc/irc.h index 4ec4d4d98..41591045f 100644 --- a/src/irc/irc.h +++ b/src/irc/irc.h @@ -210,6 +210,8 @@ extern int irc_cmd_send_ping (t_irc_server *, int, char **); extern int irc_cmd_send_pong (t_irc_server *, int, char **); extern int irc_cmd_send_quit (t_irc_server *, char *); extern int irc_cmd_send_quote (t_irc_server *, char *); +extern int irc_cmd_send_rehash (t_irc_server *, char *); +extern int irc_cmd_send_restart (t_irc_server *, char *); extern int irc_cmd_send_topic (t_irc_server *, char *); extern int irc_cmd_send_version (t_irc_server *, char *); extern int irc_cmd_send_voice (t_irc_server *, int, char **); -- cgit v1.2.3