- }
-
- catch (...)
- {
- ServerInstance->Log(DEBUG,"Exception in User::UnOper()");
- }
-}
-
-void User::QuitUser(InspIRCd* Instance, User *user, const std::string &quitreason, const char* operreason)
-{
- Instance->Log(DEBUG,"QuitUser: %s '%s'", user->nick, quitreason.c_str());
- user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident, user->host, *operreason ? operreason : quitreason.c_str());
- user->muted = true;
- Instance->GlobalCulls.AddItem(user, quitreason.c_str(), operreason);
-}
-
-/* adds or updates an entry in the whowas list */
-void User::AddToWhoWas()
-{
- Command* whowas_command = ServerInstance->Parser->GetHandler("WHOWAS");
- if (whowas_command)
- {
- std::deque<classbase*> params;
- params.push_back(this);
- whowas_command->HandleInternal(WHOWAS_ADD, params);
- }
-}
-
-/* add a client connection to the sockets list */
-void User::AddClient(InspIRCd* Instance, int socket, int port, bool iscached, int socketfamily, sockaddr* ip)
-{
- /* NOTE: Calling this one parameter constructor for User automatically
- * allocates a new UUID and places it in the hash_map.
- */
- User* New = NULL;
- try
- {
- New = new User(Instance);
- }
- catch (...)
- {
- Instance->Log(DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
- Instance->WriteOpers("*** WARNING *** Duplicate UUID allocated!");
- return;
- }
-
- Instance->Log(DEBUG,"New user fd: %d", socket);
-
- int j = 0;
-
- Instance->unregistered_count++;
-
- char ipaddr[MAXBUF];
-#ifdef IPV6
- if (socketfamily == AF_INET6)
- inet_ntop(AF_INET6, &((const sockaddr_in6*)ip)->sin6_addr, ipaddr, sizeof(ipaddr));
- else
-#endif
- inet_ntop(AF_INET, &((const sockaddr_in*)ip)->sin_addr, ipaddr, sizeof(ipaddr));
-
- (*(Instance->clientlist))[New->uuid] = New;
- New->SetFd(socket);
-
- /* The users default nick is their UUID */
- strlcpy(New->nick, New->uuid, NICKMAX - 1);
-
- New->server = Instance->FindServerNamePtr(Instance->Config->ServerName);
- /* We don't need range checking here, we KNOW 'unknown\0' will fit into the ident field. */
- strcpy(New->ident, "unknown");
-
- New->registered = REG_NONE;
- New->signon = Instance->Time() + Instance->Config->dns_timeout;
- New->lastping = 1;