src/irc_conn.c
changeset 21 0911d0b828d4
parent 20 d9c4c2980a0d
child 22 c339c020fd33
--- 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,               },
 };