--- a/src/irc_conn.c Sun Mar 01 00:34:33 2009 +0200
+++ b/src/irc_conn.c Sun Mar 01 01:48:14 2009 +0200
@@ -1,10 +1,20 @@
#include "irc_conn.h"
+#include "irc_cmd.h"
#include <stdlib.h>
#include <string.h>
/*
+ * "Welcome to the Internet Relay Network <nick>!<user>@<host>"
+ */
+static void on_RPL_WELCOME (struct irc_conn *conn, const struct irc_line *line)
+{
+ // update state
+ conn->registered = true;
+}
+
+/*
* PING <server1> [ <server2> ]
*
* Send a 'PONG <server1>` reply right away.
@@ -26,6 +36,7 @@
void (*func) (struct irc_conn *conn, const struct irc_line *line);
} _cmd_handlers[] = {
+ { IRC_RPL_WELCOME, on_RPL_WELCOME },
{ "PING", on_PING },
{ NULL, NULL, },
};