From deeadee88577ecf91a7fe579a4a69b736c7b0a95 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 21 May 2013 02:10:14 +0000 Subject: [PATCH] - find_person() and find_client(): make UID aware. if a Person is passed as the aClient ptr, do not check UIDs. --- src/parse.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/parse.c b/src/parse.c index ede10e7ae..37aa395a7 100644 --- a/src/parse.c +++ b/src/parse.c @@ -62,14 +62,17 @@ static void remove_unknown(aClient *, char *); ** the old. 'name' is now assumed to be a null terminated ** string and the search is the for server and user. */ -aClient inline *find_client(char *name, aClient *cptr) +aClient *find_client(char *name, aClient *cptr) { - - if (name) + if (cptr == NULL || IsServer(cptr)) { - cptr = hash_find_client(name, cptr); + aClient *acptr; + + if ((acptr = hash_find_id(name, NULL)) != NULL) + return acptr; } - return cptr; + + return hash_find_client(name, NULL); } aClient inline *find_nickserv(char *name, aClient *cptr) @@ -133,14 +136,14 @@ aClient inline *find_name(char *name, aClient *cptr) */ aClient *find_person(char *name, aClient *cptr) { - aClient *c2ptr = cptr; + aClient *c2ptr; - c2ptr = find_client(name, c2ptr); + c2ptr = find_client(name, cptr); if (c2ptr && IsClient(c2ptr) && c2ptr->user) return c2ptr; - else - return cptr; + + return NULL; }