From 0c9434cde9c972f488abc7a2e72aacdd92f31f8b Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 27 Aug 2007 01:01:20 +0000 Subject: Add InspIRCd::FindUUID() methods. Currently, these work off an iteration around the whole client list. This sucks, and will be changed to a map the same as FindNick(). Also update FindNick's docs a little out of anal habit: it returns a user, not a nick. :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7855 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 9363e3376..fae9759d9 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -255,6 +255,24 @@ userrec* InspIRCd::FindNick(const char* nick) return iter->second; } +userrec *InspIRCd::FindUUID(const std::string &uid) +{ + return InspIRCd::FindUID(uid.c_str()); +} + +userrec *InspIRCd::FindUUID(const char *uid) +{ + for (user_hash::const_iterator a = ServerInstance->clientlist->begin(); a != ServerInstance->clientlist->end(); a++) + { + userrec *u = a->second; + + if (strcmp(u->uuid, uid) == 0 + { + return u; + } + } +} + /* find a channel record by channel name and return a pointer to it */ chanrec* InspIRCd::FindChan(const char* chan) { -- cgit v1.2.3