169 |
* side effects - Does whois |
* side effects - Does whois |
170 |
*/ |
*/ |
171 |
static void |
static void |
172 |
do_whois(struct Client *source_p, int parc, char *parv[]) |
do_whois(struct Client *source_p, const char *name) |
173 |
{ |
{ |
174 |
struct Client *target_p = NULL; |
struct Client *target_p = NULL; |
|
char *nick = parv[1]; |
|
|
char *p = NULL; |
|
175 |
|
|
176 |
if ((p = strchr(nick, ',')) != NULL) |
if ((target_p = hash_find_client(name)) && IsClient(target_p)) |
|
*p = '\0'; |
|
|
if (*nick == '\0') |
|
|
return; |
|
|
|
|
|
if ((target_p = hash_find_client(nick)) && IsClient(target_p)) |
|
177 |
whois_person(source_p, target_p); |
whois_person(source_p, target_p); |
178 |
else if (!IsDigit(*nick)) |
else if (!IsDigit(*name)) |
179 |
sendto_one(source_p, form_str(ERR_NOSUCHNICK), |
sendto_one(source_p, form_str(ERR_NOSUCHNICK), |
180 |
me.name, source_p->name, nick); |
me.name, source_p->name, name); |
181 |
|
|
182 |
sendto_one(source_p, form_str(RPL_ENDOFWHOIS), |
sendto_one(source_p, form_str(RPL_ENDOFWHOIS), |
183 |
me.name, source_p->name, nick); |
me.name, source_p->name, name); |
184 |
} |
} |
185 |
|
|
186 |
/* |
/* |
228 |
parv[1] = parv[2]; |
parv[1] = parv[2]; |
229 |
} |
} |
230 |
|
|
231 |
do_whois(source_p, parc, parv); |
do_whois(source_p, parv[1]); |
232 |
} |
} |
233 |
|
|
234 |
/* |
/* |
256 |
parv[1] = parv[2]; |
parv[1] = parv[2]; |
257 |
} |
} |
258 |
|
|
259 |
do_whois(source_p, parc, parv); |
do_whois(source_p, parv[1]); |
260 |
} |
} |
261 |
|
|
262 |
static struct Message whois_msgtab = { |
static struct Message whois_msgtab = { |