aboutsummaryrefslogtreecommitdiffstats
path: root/ipc.c
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 /ipc.c
parent0431ea17870f5c382fe5fb692c2852ae80432737 (diff)
s/WALLOP/WALLOPS/, added LILO command.
Diffstat (limited to 'ipc.c')
-rw-r--r--ipc.c24
1 files changed, 18 insertions, 6 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 }
};