| 35 |
|
#include "parse.h" |
| 36 |
|
#include "modules.h" |
| 37 |
|
#include "conf.h" |
| 38 |
+ |
#include "conf_class.h" |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
static void do_actual_trace(struct Client *, int, char *[]); |
| 164 |
|
do_actual_trace(struct Client *source_p, int parc, char *parv[]) |
| 165 |
|
{ |
| 166 |
|
struct Client *target_p = NULL; |
| 166 |
– |
struct ConfItem *conf; |
| 167 |
– |
struct ClassItem *cltmp; |
| 167 |
|
int doall = 0; |
| 168 |
|
int wilds, dow; |
| 169 |
|
dlink_node *ptr; |
| 185 |
|
to = source_p->name; |
| 186 |
|
} |
| 187 |
|
|
| 188 |
< |
sendto_realops_flags(UMODE_SPY, L_ALL, |
| 188 |
> |
sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE, |
| 189 |
|
"TRACE requested by %s (%s@%s) [%s]", |
| 190 |
|
source_p->name, source_p->username, |
| 191 |
|
source_p->host, source_p->servptr->name); |
| 206 |
|
/* lets also do this for opers tracing nicks */ |
| 207 |
|
{ |
| 208 |
|
const char *name; |
| 210 |
– |
const char *class_name; |
| 211 |
– |
|
| 209 |
|
target_p = hash_find_client(tname); |
| 210 |
|
|
| 211 |
|
if (target_p && IsClient(target_p)) |
| 212 |
|
{ |
| 213 |
|
name = get_client_name(target_p, HIDE_IP); |
| 217 |
– |
class_name = get_client_class(target_p); |
| 214 |
|
|
| 215 |
|
if (HasUMode(target_p, UMODE_OPER)) |
| 216 |
|
{ |
| 217 |
|
sendto_one(source_p, form_str(RPL_TRACEOPERATOR), |
| 218 |
< |
from, to, class_name, name, |
| 218 |
> |
from, to, get_client_class(&target_p->localClient->confs), name, |
| 219 |
|
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 220 |
|
CurrentTime - target_p->localClient->lasttime, |
| 221 |
|
CurrentTime - target_p->localClient->last_privmsg); |
| 223 |
|
else |
| 224 |
|
{ |
| 225 |
|
sendto_one(source_p,form_str(RPL_TRACEUSER), |
| 226 |
< |
from, to, class_name, name, |
| 226 |
> |
from, to, get_client_class(&target_p->localClient->confs), name, |
| 227 |
|
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 228 |
|
CurrentTime - target_p->localClient->lasttime, |
| 229 |
|
CurrentTime - target_p->localClient->last_privmsg); |
| 277 |
|
report_this_status(source_p, target_p, dow); |
| 278 |
|
} |
| 279 |
|
|
| 280 |
< |
DLINK_FOREACH(ptr, class_items.head) |
| 280 |
> |
DLINK_FOREACH(ptr, class_get_list()->head) |
| 281 |
|
{ |
| 282 |
< |
conf = ptr->data; |
| 287 |
< |
cltmp = map_to_conf(conf); |
| 282 |
> |
const struct ClassItem *class = ptr->data; |
| 283 |
|
|
| 284 |
< |
if (cltmp->curr_user_count > 0) |
| 284 |
> |
if (class->ref_count > 0) |
| 285 |
|
sendto_one(source_p, form_str(RPL_TRACECLASS), |
| 286 |
< |
from, to, conf->name, cltmp->curr_user_count); |
| 286 |
> |
from, to, class->name, class->ref_count); |
| 287 |
|
} |
| 288 |
|
|
| 289 |
|
sendto_one(source_p, form_str(RPL_ENDOFTRACE), from, to, tname); |
| 315 |
|
} |
| 316 |
|
|
| 317 |
|
name = get_client_name(target_p, HIDE_IP); |
| 318 |
< |
class_name = get_client_class(target_p); |
| 318 |
> |
class_name = get_client_class(&target_p->localClient->confs); |
| 319 |
|
|
| 320 |
|
set_time(); |
| 321 |
|
|
| 374 |
|
} |
| 375 |
|
else |
| 376 |
|
{ |
| 382 |
– |
const char *format_str=NULL; |
| 383 |
– |
if (HasUMode(source_p, UMODE_OPER) && IsCaptured(target_p)) |
| 384 |
– |
format_str = form_str(RPL_TRACECAPTURED); |
| 385 |
– |
else |
| 386 |
– |
format_str = form_str(RPL_TRACEUSER); |
| 387 |
– |
|
| 377 |
|
if (ConfigFileEntry.hide_spoof_ips) |
| 378 |
< |
sendto_one(source_p, format_str, |
| 378 |
> |
sendto_one(source_p, form_str(RPL_TRACEUSER), |
| 379 |
|
from, to, class_name, name, |
| 380 |
|
IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost, |
| 381 |
|
CurrentTime - target_p->localClient->lasttime, |
| 382 |
|
CurrentTime - target_p->localClient->last_privmsg); |
| 383 |
|
else |
| 384 |
< |
sendto_one(source_p, format_str, |
| 384 |
> |
sendto_one(source_p, form_str(RPL_TRACEUSER), |
| 385 |
|
from, to, class_name, name, |
| 386 |
|
MyOper(source_p) ? target_p->sockhost : |
| 387 |
|
(IsIPSpoof(target_p) ? "255.255.255.255" : target_p->sockhost), |