565 |
|
* output - return client pointer |
566 |
|
* side effects - find person by (nick)name |
567 |
|
*/ |
568 |
– |
/* XXX - ugly wrapper */ |
568 |
|
struct Client * |
569 |
< |
find_person(const struct Client *client_p, const char *name) |
569 |
> |
find_person(const struct Client *source_p, const char *name) |
570 |
|
{ |
571 |
< |
struct Client *c2ptr; |
571 |
> |
struct Client *target_p = NULL; |
572 |
|
|
573 |
< |
if (IsDigit(*name)) |
574 |
< |
{ |
576 |
< |
if ((c2ptr = hash_find_id(name)) != NULL) |
577 |
< |
{ |
578 |
< |
/* invisible users shall not be found by UID guessing */ |
579 |
< |
if (IsInvisible(c2ptr) && !IsServer(client_p)) |
580 |
< |
c2ptr = NULL; |
581 |
< |
} |
582 |
< |
} |
573 |
> |
if (IsDigit(*name) && IsServer(source_p->from)) |
574 |
> |
target_p = hash_find_id(name); |
575 |
|
else |
576 |
< |
c2ptr = find_client(name); |
576 |
> |
target_p = find_client(name); |
577 |
|
|
578 |
< |
return ((c2ptr != NULL && IsClient(c2ptr)) ? c2ptr : NULL); |
578 |
> |
return (target_p && IsClient(target_p)) ? target_p : NULL; |
579 |
|
} |
580 |
|
|
581 |
|
/* |
585 |
|
* through the history, chasing will be 1 and otherwise 0. |
586 |
|
*/ |
587 |
|
struct Client * |
588 |
< |
find_chasing(struct Client *client_p, struct Client *source_p, const char *user, int *chasing) |
588 |
> |
find_chasing(struct Client *source_p, const char *user, int *chasing) |
589 |
|
{ |
590 |
< |
struct Client *who = find_person(client_p, user); |
590 |
> |
struct Client *who = find_person(source_p, user); |
591 |
|
|
592 |
|
if (chasing) |
593 |
|
*chasing = 0; |