From 90ee2ee38c733520a8d149f90498bdbdb6091d67 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 27 Aug 2007 13:54:15 +0000 Subject: Add FindNickOnly, that wont fall through to uid checks if isdigit(*first). We may need this. (i thought we did for this fix, we dont) Fix cmd_nick to not treat all nicks as invalid and make the client give up. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7883 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 4338fb9da..66c9f21ba 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -261,9 +261,29 @@ userrec* InspIRCd::FindNick(const char* nick) return iter->second; } +userrec* InspIRCd::FindNickOnly(const std::string &nick) +{ + user_hash::iterator iter = clientlist->find(nick); + + if (iter == clientlist->end()) + return NULL; + + return iter->second; +} + +userrec* InspIRCd::FindNickOnly(const char* nick) +{ + user_hash::iterator iter = clientlist->find(nick); + + if (iter == clientlist->end()) + return NULL; + + return iter->second; +} + userrec *InspIRCd::FindUUID(const std::string &uid) { - return InspIRCd::FindUUID(uid.c_str()); + return FindUUID(uid.c_str()); } userrec *InspIRCd::FindUUID(const char *uid) -- cgit v1.2.3