]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Make nickname-overruled rules change the user back to their uid, not to nnn-unknown
[user/henk/code/inspircd.git] / src / users.cpp
index 1dbdb5b407a6e62395050f4539e946cbd76027a4..b76df8ac5aea938dea1fbe1618125dbe0a7a8e1c 100644 (file)
@@ -858,7 +858,9 @@ void userrec::AddToWhoWas()
 /* add a client connection to the sockets list */
 void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached, int socketfamily, sockaddr* ip)
 {
-       std::string tempnick = ConvToStr(socket) + "-unknown";
+       std::string tempnick = Instance->GetUID();
+
+       Instance->Log(DEBUG,"New client has UID %s ..", tempnick.c_str());
        user_hash::iterator iter = Instance->clientlist->find(tempnick);
        char ipaddr[MAXBUF];
 #ifdef IPV6
@@ -891,7 +893,8 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
        New = new userrec(Instance);
        (*(Instance->clientlist))[tempnick] = New;
        New->fd = socket;
-       strlcpy(New->nick,tempnick.c_str(),NICKMAX-1);
+       strlcpy(New->nick, tempnick.c_str(), NICKMAX - 1);
+       strlcpy(New->uuid, tempnick.c_str(), UUID_LENGTH);
 
        New->server = Instance->FindServerNamePtr(Instance->Config->ServerName);
        /* We don't need range checking here, we KNOW 'unknown\0' will fit into the ident field. */
@@ -1098,6 +1101,9 @@ void userrec::FullConnect()
 
        ServerInstance->Config->Send005(this);
 
+       this->WriteServ("042 %s %s :your unique ID", this->nick, this->uuid);
+
+
        this->ShowMOTD();
 
        /* Now registered */