static void event_notice (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) { char buf[256]; if ( !origin ) return; if ( strcasecmp (origin, "nickserv") ) return; if ( strstr (params[1], "This nick is not registered") == params[1] ) { sprintf (buf, "REGISTER %s NOMAIL", gCfg.irc_nickserv_password); irc_cmd_msg (session, "nickserv", buf); } else if ( strstr (params[1], "This nickname is registered and protected") == params[1] ) { sprintf (buf, "IDENTIFY %s", gCfg.irc_nickserv_password); irc_cmd_msg (session, "nickserv", buf); } else if ( strstr (params[1], "Password accepted - you are now recognized") == params[1] ) printf ("Nickserv authentication succeed."); }
The idea is to parse the messages sent from NICKSERV, and if they're matched the specific patterns, react on them appropriately.
+o
means that this user is an IRC network operator, not just a channel operator.
WORD wVersionRequested = MAKEWORD (1, 1); WSADATA wsaData; if ( WSAStartup (wVersionRequested, &wsaData) != 0 ) // report an error // And now we can use libircclient