]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_nick.cpp
userrec::UpdateNickHash(), userrec::ForceNickChange(), userrec::FullConnect()
[user/henk/code/inspircd.git] / src / cmd_nick.cpp
index ab286bee4b2ca925341e91d8f1ee2a33fcc89d17..cdb37690ef3d18b847bee788798060912b666a94 100644 (file)
@@ -23,7 +23,6 @@
 #include "modules.h"
 #include "commands.h"
 #include "xline.h"
-#include "dnsqueue.h"
 #include "dns.h"
 #include "helperfuncs.h"
 #include "hashcomp.h"
@@ -125,7 +124,7 @@ void cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
        strlcpy(oldnick, user->nick, NICKMAX - 1);
 
        /* change the nick of the user in the users_hash */
-       user = ReHashNick(user->nick, parameters[0]);
+       user = user->UpdateNickHash(parameters[0]);
        /* actually change the nick within the record */
        if (!user) return;
        if (!user->nick) return;
@@ -149,20 +148,9 @@ void cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
                }
                else
                {
-#ifdef THREADED_DNS
-                       // initialize their dns lookup thread
-                       pthread_attr_t attribs;
-                       pthread_attr_init(&attribs);
-                       pthread_attr_setdetachstate(&attribs, PTHREAD_CREATE_DETACHED);
-                       if (pthread_create(&user->dnsthread, &attribs, dns_task, (void *)user) != 0)
-                       {
-                               log(DEBUG,"Failed to create DNS lookup thread for user %s: %s",user->nick, strerror(errno));
-                       }
-#else
-                       user->dns_done = (!lookup_dns(user->nick));
+                       user->StartDNSLookup();
                        if (user->dns_done)
                                log(DEBUG,"Aborting dns lookup of %s because dns server experienced a failure.",user->nick);
-#endif
                }
        }
        if (user->registered == REG_NICKUSER)