| 53 |
|
#include "listener.h" |
| 54 |
|
#include "irc_res.h" |
| 55 |
|
#include "userhost.h" |
| 56 |
+ |
#include "watch.h" |
| 57 |
|
|
| 58 |
|
dlink_list listing_client_list = { NULL, NULL, 0 }; |
| 59 |
|
/* Pointer to beginning of Client list */ |
| 766 |
|
add_history(source_p, 0); |
| 767 |
|
off_history(source_p); |
| 768 |
|
|
| 769 |
+ |
watch_check_hash(source_p, RPL_LOGOFF); |
| 770 |
+ |
|
| 771 |
|
if (!MyConnect(source_p)) |
| 772 |
|
{ |
| 773 |
|
source_p->from->serv->dep_users--; |
| 969 |
|
if (source_p->localClient->list_task != NULL) |
| 970 |
|
free_list_task(source_p->localClient->list_task, source_p); |
| 971 |
|
|
| 972 |
+ |
watch_del_watch_list(source_p); |
| 973 |
|
sendto_realops_flags(UMODE_CCONN, L_ALL, "Client exiting: %s (%s@%s) [%s] [%s]", |
| 974 |
|
source_p->name, source_p->username, source_p->host, comment, |
| 975 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
| 976 |
|
"255.255.255.255" : source_p->sockhost); |
| 977 |
+ |
sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, "CLIEXIT: %s %s %s %s 0 %s", |
| 978 |
+ |
source_p->name, |
| 979 |
+ |
source_p->username, |
| 980 |
+ |
source_p->host, |
| 981 |
+ |
|
| 982 |
+ |
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
| 983 |
+ |
"255.255.255.255" : source_p->sockhost, |
| 984 |
+ |
comment); |
| 985 |
|
} |
| 986 |
|
|
| 987 |
|
/* As soon as a client is known to be a server of some sort |
| 1392 |
|
void |
| 1393 |
|
change_local_nick(struct Client *client_p, struct Client *source_p, const char *nick) |
| 1394 |
|
{ |
| 1395 |
+ |
int samenick = 0; |
| 1396 |
+ |
|
| 1397 |
|
/* |
| 1398 |
|
** Client just changing his/her nick. If he/she is |
| 1399 |
|
** on a channel, send note of change to all clients |
| 1411 |
|
!ConfigFileEntry.anti_nick_flood || |
| 1412 |
|
(IsOper(source_p) && ConfigFileEntry.no_oper_flood)) |
| 1413 |
|
{ |
| 1414 |
< |
if (irccmp(source_p->name, nick)) |
| 1414 |
> |
samenick = !irccmp(source_p->name, nick); |
| 1415 |
> |
|
| 1416 |
> |
if (!samenick) |
| 1417 |
> |
{ |
| 1418 |
> |
/* |
| 1419 |
> |
* Make sure everyone that has this client on its accept list |
| 1420 |
> |
* loses that reference. |
| 1421 |
> |
*/ |
| 1422 |
> |
del_all_their_accepts(source_p); |
| 1423 |
|
source_p->tsinfo = CurrentTime; |
| 1424 |
+ |
clear_ban_cache_client(source_p); |
| 1425 |
+ |
} |
| 1426 |
|
|
| 1427 |
|
/* XXX - the format of this notice should eventually be changed |
| 1428 |
|
* to either %s[%s@%s], or even better would be get_client_name() -bill |
| 1432 |
|
sendto_common_channels_local(source_p, 1, ":%s!%s@%s NICK :%s", |
| 1433 |
|
source_p->name, source_p->username, |
| 1434 |
|
source_p->host, nick); |
| 1411 |
– |
|
| 1435 |
|
add_history(source_p, 1); |
| 1436 |
< |
|
| 1437 |
< |
/* Only hubs care about lazy link nicks not being sent on yet |
| 1438 |
< |
* lazylink leafs/leafs always send their nicks up to hub, |
| 1439 |
< |
* hence must always propagate nick changes. |
| 1440 |
< |
* hubs might not propagate a nick change, if the leaf |
| 1441 |
< |
* does not know about that client yet. |
| 1442 |
< |
*/ |
| 1436 |
> |
|
| 1437 |
> |
/* |
| 1438 |
> |
* Only hubs care about lazy link nicks not being sent on yet |
| 1439 |
> |
* lazylink leafs/leafs always send their nicks up to hub, |
| 1440 |
> |
* hence must always propagate nick changes. |
| 1441 |
> |
* hubs might not propagate a nick change, if the leaf |
| 1442 |
> |
* does not know about that client yet. |
| 1443 |
> |
*/ |
| 1444 |
|
sendto_server(client_p, source_p, NULL, CAP_TS6, NOCAPS, NOFLAGS, |
| 1445 |
|
":%s NICK %s :%lu", |
| 1446 |
|
ID(source_p), nick, (unsigned long)source_p->tsinfo); |
| 1460 |
|
if (source_p->name[0]) |
| 1461 |
|
hash_del_client(source_p); |
| 1462 |
|
|
| 1463 |
+ |
if (!samenick) |
| 1464 |
+ |
{ |
| 1465 |
+ |
clear_ban_cache_client(source_p); |
| 1466 |
+ |
watch_check_hash(source_p, RPL_LOGOFF); |
| 1467 |
+ |
} |
| 1468 |
+ |
|
| 1469 |
|
strcpy(source_p->name, nick); |
| 1470 |
|
hash_add_client(source_p); |
| 1471 |
|
|
| 1472 |
< |
/* Make sure everyone that has this client on its accept list |
| 1473 |
< |
* loses that reference. |
| 1444 |
< |
*/ |
| 1445 |
< |
del_all_their_accepts(source_p); |
| 1472 |
> |
if (!samenick) |
| 1473 |
> |
watch_check_hash(source_p, RPL_LOGON); |
| 1474 |
|
|
| 1475 |
|
/* fd_desc is long enough */ |
| 1476 |
|
fd_note(&client_p->localClient->fd, "Nick: %s", nick); |