aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-01-15 12:33:54 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2006-01-15 12:33:54 +0100
commite0ca412a709c80cc7fe26db0576c2bc38be4a45a (patch)
tree587269cb4c665168a09d0d3a1b4460af799a9fc6
parent0431ea17870f5c382fe5fb692c2852ae80432737 (diff)
s/WALLOP/WALLOPS/, added LILO command.
-rw-r--r--ipc.c24
-rw-r--r--irc_commands.c3
2 files changed, 20 insertions, 7 deletions
diff --git a/ipc.c b/ipc.c
index 81ef4ce8..a60a1c0c 100644
--- a/ipc.c
+++ b/ipc.c
@@ -32,16 +32,17 @@ GSList *child_list = NULL;
static int ipc_master_cmd_die( irc_t *data, char **cmd )
{
+ /* This shouldn't really be the final implementation... */
exit( 0 );
}
-static int ipc_master_cmd_wallop( irc_t *data, char **cmd )
+static int ipc_master_cmd_wallops( irc_t *data, char **cmd )
{
GSList *l;
char msg_buf[513];
int msg_len;
- if( ( msg_len = g_snprintf( msg_buf, sizeof( msg_buf ) - 1, "WALLOP :%s\r\n", cmd[1] ) ) > ( sizeof( msg_buf ) - 1 ) )
+ if( ( msg_len = g_snprintf( msg_buf, sizeof( msg_buf ) - 1, "%s :%s\r\n", cmd[0], cmd[1] ) ) > ( sizeof( msg_buf ) - 1 ) )
return 0;
for( l = child_list; l; l = l->next )
@@ -55,22 +56,33 @@ static int ipc_master_cmd_wallop( irc_t *data, char **cmd )
static const command_t ipc_master_commands[] = {
{ "die", 0, ipc_master_cmd_die, 0 },
- { "wallop", 1, ipc_master_cmd_wallop, 1 },
+ { "wallops", 1, ipc_master_cmd_wallops, 1 },
+ { "lilo", 1, ipc_master_cmd_wallops, 1 },
{ NULL }
};
-static int ipc_child_cmd_wallop( irc_t *data, char **cmd )
+static int ipc_child_cmd_wallops( irc_t *data, char **cmd )
{
irc_t *irc = data;
if( strchr( irc->umode, 'w' ) )
- irc_write( irc, ":%s WALLOP :%s", irc->myhost, cmd[1] );
+ irc_write( irc, ":%s WALLOPS :%s", irc->myhost, cmd[1] );
+
+ return 1;
+}
+
+static int ipc_child_cmd_lilo( irc_t *data, char **cmd )
+{
+ irc_t *irc = data;
+
+ irc_write( irc, ":%s NOTICE %s :%s", irc->myhost, irc->nick, cmd[1] );
return 1;
}
static const command_t ipc_child_commands[] = {
- { "wallop", 1, ipc_child_cmd_wallop, 1 },
+ { "wallops", 1, ipc_child_cmd_wallops, 1 },
+ { "lilo", 1, ipc_child_cmd_lilo, 1 },
{ NULL }
};
diff --git a/irc_commands.c b/irc_commands.c
index 3ef5566e..b2bde17b 100644
--- a/irc_commands.c
+++ b/irc_commands.c
@@ -607,7 +607,8 @@ static const command_t irc_commands[] = {
{ "pong", 0, irc_cmd_pong, IRC_CMD_LOGGED_IN },
{ "completions", 0, irc_cmd_completions, IRC_CMD_LOGGED_IN },
{ "die", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
- { "wallop", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
+ { "wallops", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
+ { "lilo", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
{ NULL }
};