diff options
author | Adam <Adam@drink-coca-cola.info> | 2010-05-29 20:44:31 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 21:04:08 -0400 |
commit | b8f9116b19eb511c4f5e6a683725f50bf732a7dd (patch) | |
tree | a5848c9797ec4dc3477621fc42211f4985eaec7b /src/users.cpp | |
parent | 435c9116e9997634eb7215e998c8f01a5e46fb2c (diff) |
Rewrote all of the command handling to get rid of all the nasty strtoks() everywhere, and added a bot map by uid
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/src/users.cpp b/src/users.cpp index b01862479..5c88f9666 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -503,7 +503,6 @@ void User::UpdateHost() return; NickAlias *na = findnick(this->nick); - OnAccess = false; if (na) OnAccess = is_on_access(this, na->nc); @@ -743,10 +742,14 @@ User *finduser(const std::string &nick) User *finduser(const ci::string &nick) { - Alog(LOG_DEBUG_3) << "finduser("<< nick << ")"; - if (isdigit(nick[0]) && ircd->ts6) - return find_byuid(nick); + { + user_uid_map::const_iterator it = UserListByUID.find(nick.c_str()); + + if (it != UserListByUID.end()) + return it->second; + return NULL; + } user_map::const_iterator it = UserListByNick.find(nick); @@ -755,27 +758,6 @@ User *finduser(const ci::string &nick) return NULL; } -User *find_byuid(const char *uid) -{ - return find_byuid(std::string(uid)); -} - -User *find_byuid(const ci::string &uid) -{ - return find_byuid(std::string(uid.c_str())); -} - -User *find_byuid(const std::string &uid) -{ - Alog(LOG_DEBUG_3) << "finduser_byuid(" << uid << ")"; - - user_uid_map::iterator it = UserListByUID.find(uid); - - if (it != UserListByUID.end()) - return it->second; - return NULL; -} - /*************************************************************************/ /* Handle a server NICK command. */ @@ -874,11 +856,7 @@ User *do_nick(const char *source, const char *nick, const char *username, const else { /* An old user changing nicks. */ - if (ircd->ts6) - user = find_byuid(source); - - if (!user) - user = finduser(source); + user = finduser(source); if (!user) { Alog() << "user: NICK from nonexistent nick " << source; |