| 19 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 20 |
|
* USA |
| 21 |
|
* |
| 22 |
< |
* $Id: m_whois.c,v 1.145 2005/09/27 12:43:33 adx Exp $ |
| 22 |
> |
* $Id$ |
| 23 |
|
*/ |
| 24 |
|
|
| 25 |
|
#include "stdinc.h" |
| 59 |
|
}; |
| 60 |
|
|
| 61 |
|
#ifndef STATIC_MODULES |
| 62 |
< |
const char *_version = "$Revision: 1.145 $"; |
| 62 |
> |
const char *_version = "$Revision$"; |
| 63 |
|
static struct Callback *whois_cb; |
| 64 |
|
|
| 65 |
|
static void * |
| 106 |
|
return; |
| 107 |
|
} |
| 108 |
|
|
| 109 |
< |
if (parc > 2) |
| 109 |
> |
if (parc > 2 && !EmptyString(parv[2])) |
| 110 |
|
{ |
| 111 |
|
/* seeing as this is going across servers, we should limit it */ |
| 112 |
|
if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) |
| 155 |
|
return; |
| 156 |
|
} |
| 157 |
|
|
| 158 |
< |
if (parc > 2) |
| 158 |
> |
if (parc > 2 && !EmptyString(parv[2])) |
| 159 |
|
{ |
| 160 |
|
if (hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, |
| 161 |
|
parc, parv) != HUNTED_ISME) |
| 182 |
|
static void |
| 183 |
|
do_whois(struct Client *source_p, int parc, char **parv) |
| 184 |
|
{ |
| 185 |
+ |
static time_t last_used = 0; |
| 186 |
|
struct Client *target_p; |
| 187 |
|
char *nick; |
| 188 |
|
char *p = NULL; |
| 204 |
|
if ((target_p = find_client(nick)) != NULL) |
| 205 |
|
{ |
| 206 |
|
if (IsServer(source_p->from)) |
| 207 |
< |
client_burst_if_needed(source_p->from, target_p); |
| 207 |
> |
client_burst_if_needed(source_p->from, target_p); |
| 208 |
|
|
| 209 |
|
if (IsClient(target_p)) |
| 210 |
|
{ |
| 211 |
< |
whois_person(source_p, target_p); |
| 212 |
< |
found = 1; |
| 211 |
> |
whois_person(source_p, target_p); |
| 212 |
> |
found = 1; |
| 213 |
|
} |
| 214 |
|
} |
| 215 |
|
else if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL)) |
| 229 |
|
if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL)) |
| 230 |
|
return; |
| 231 |
|
|
| 232 |
+ |
if (!IsOper(source_p)) |
| 233 |
+ |
{ |
| 234 |
+ |
if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) |
| 235 |
+ |
{ |
| 236 |
+ |
sendto_one(source_p, form_str(RPL_LOAD2HI), |
| 237 |
+ |
me.name, source_p->name); |
| 238 |
+ |
return; |
| 239 |
+ |
} |
| 240 |
+ |
else |
| 241 |
+ |
last_used = CurrentTime; |
| 242 |
+ |
} |
| 243 |
+ |
|
| 244 |
|
/* Oh-oh wilds is true so have to do it the hard expensive way */ |
| 245 |
|
if (MyClient(source_p)) |
| 246 |
|
found = global_whois(source_p, nick); |
| 424 |
|
sendto_one(source_p, form_str(RPL_ISCAPTURED), |
| 425 |
|
me.name, source_p->name, target_p->name); |
| 426 |
|
|
| 427 |
< |
if (ConfigFileEntry.use_whois_actually && (target_p->sockhost[0] != '\0') && |
| 428 |
< |
!(ConfigFileEntry.hide_spoof_ips && IsIPSpoof(target_p)) && |
| 429 |
< |
!(target_p->sockhost[0] == '0' && target_p->sockhost[1] == '\0')) |
| 430 |
< |
{ |
| 431 |
< |
if (IsAdmin(source_p) || source_p == target_p) |
| 432 |
< |
sendto_one(source_p, form_str(RPL_WHOISACTUALLY), |
| 433 |
< |
me.name, source_p->name, target_p->name, target_p->sockhost); |
| 434 |
< |
else |
| 435 |
< |
sendto_one(source_p, form_str(RPL_WHOISACTUALLY), |
| 436 |
< |
me.name, source_p->name, target_p->name, |
| 437 |
< |
IsIPSpoof(target_p) || IsOper(target_p) ? |
| 438 |
< |
"255.255.255.255" : target_p->sockhost); |
| 427 |
> |
if (ConfigFileEntry.use_whois_actually) |
| 428 |
> |
{ |
| 429 |
> |
int show_ip = 0; |
| 430 |
> |
|
| 431 |
> |
if ((target_p->sockhost[0] != '\0') && (target_p->sockhost[0] == '0' && |
| 432 |
> |
target_p->sockhost[1] == '\0')) |
| 433 |
> |
{ |
| 434 |
> |
if ((IsAdmin(source_p) || source_p == target_p)) |
| 435 |
> |
show_ip = 1; |
| 436 |
> |
else if (IsIPSpoof(target_p)) |
| 437 |
> |
show_ip = (IsOper(source_p) && !ConfigFileEntry.hide_spoof_ips); |
| 438 |
> |
else |
| 439 |
> |
show_ip = 1; |
| 440 |
> |
|
| 441 |
> |
sendto_one(source_p, form_str(RPL_WHOISACTUALLY), |
| 442 |
> |
me.name, source_p->name, target_p->name, |
| 443 |
> |
show_ip ? target_p->sockhost : "255.255.255.255"); |
| 444 |
> |
} |
| 445 |
|
} |
| 446 |
|
|
| 447 |
|
if (MyConnect(target_p)) /* Can't do any of this if not local! db */ |