added some code
[NextIRCd.git] / src / cmd_nick.c
index effb22f037c2b97f37b80ae667db9644287eb1d8..ae47e01eb590e66e5efae015d7695d2dc8c56e12 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
  */
 
+#include <string.h>
+
 #include "cmd.h"
 #include "struct_auth.h"
+#include "ircd_users.h"
+#include "ircd_auth.h"
 
 int cmd_nick_cli(struct Client *client, char *argv[], int argc) {
        
@@ -24,6 +28,17 @@ int cmd_nick_cli(struct Client *client, char *argv[], int argc) {
 }
 
 int cmd_nick_auth(struct Auth *auth, char *argv[], int argc) {
+       char *nick = argv[0];
+       
+       if(!is_nick_valid(nick)) {
+               
+               return 0;
+       }
+       
+       strncpy(auth->nick, nick, NICKLEN);
+       auth->have_nick = 1;
+       
+       auth_try_finish(auth);
        
        return 0;
 }