mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-06 21:03:12 +02:00
- find_person() and find_client(): make UID aware. if a Person is passed as the aClient ptr, do not check UIDs.
This commit is contained in:
+12
-9
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user