719 |
|
|
720 |
|
assert(!IsMe(source_p)); |
721 |
|
|
722 |
< |
if (IsServer(source_p)) |
723 |
< |
{ |
724 |
< |
dlinkDelete(&source_p->lnode, &source_p->servptr->serv->server_list); |
725 |
< |
|
726 |
< |
if ((lp = dlinkFindDelete(&global_serv_list, source_p)) != NULL) |
727 |
< |
free_dlink_node(lp); |
728 |
< |
} |
729 |
< |
else if (IsClient(source_p)) |
722 |
> |
if (IsClient(source_p)) |
723 |
|
{ |
724 |
|
if (source_p->servptr->serv != NULL) |
725 |
|
dlinkDelete(&source_p->lnode, &source_p->servptr->serv->client_list); |
726 |
|
|
727 |
< |
/* If a person is on a channel, send a QUIT notice |
728 |
< |
** to every client (person) on the same channel (so |
729 |
< |
** that the client can show the "**signoff" message). |
730 |
< |
** (Note: The notice is to the local clients *only*) |
731 |
< |
*/ |
727 |
> |
/* |
728 |
> |
* If a person is on a channel, send a QUIT notice |
729 |
> |
* to every client (person) on the same channel (so |
730 |
> |
* that the client can show the "**signoff" message). |
731 |
> |
* (Note: The notice is to the local clients *only*) |
732 |
> |
*/ |
733 |
|
sendto_common_channels_local(source_p, 0, ":%s!%s@%s QUIT :%s", |
734 |
|
source_p->name, source_p->username, |
735 |
|
source_p->host, quitmsg); |
750 |
|
del_all_accepts(source_p); |
751 |
|
} |
752 |
|
} |
753 |
+ |
else if (IsServer(source_p)) |
754 |
+ |
{ |
755 |
+ |
dlinkDelete(&source_p->lnode, &source_p->servptr->serv->server_list); |
756 |
+ |
|
757 |
+ |
if ((lp = dlinkFindDelete(&global_serv_list, source_p)) != NULL) |
758 |
+ |
free_dlink_node(lp); |
759 |
+ |
} |
760 |
|
|
761 |
|
/* Remove source_p from the client lists */ |
762 |
|
if (HasID(source_p)) |
796 |
|
static void |
797 |
|
recurse_send_quits(struct Client *original_source_p, struct Client *source_p, |
798 |
|
struct Client *from, struct Client *to, const char *comment, |
799 |
< |
const char *splitstr, const char *myname) |
799 |
> |
const char *splitstr) |
800 |
|
{ |
801 |
|
dlink_node *ptr, *next; |
802 |
|
struct Client *target_p; |
803 |
< |
int hidden = match(myname, source_p->name); |
803 |
> |
int hidden = match(me.name, source_p->name); /* XXX */ |
804 |
|
|
805 |
|
assert(to != source_p); /* should be already removed from serv_list */ |
806 |
|
|
819 |
|
|
820 |
|
DLINK_FOREACH_SAFE(ptr, next, source_p->serv->server_list.head) |
821 |
|
recurse_send_quits(original_source_p, ptr->data, from, to, |
822 |
< |
comment, splitstr, myname); |
822 |
> |
comment, splitstr); |
823 |
|
|
824 |
|
if (!hidden && ((source_p == original_source_p && to != from) || |
825 |
|
!IsCapable(to, CAP_QS))) |
860 |
|
remove_dependents(struct Client *source_p, struct Client *from, |
861 |
|
const char *comment, const char *splitstr) |
862 |
|
{ |
863 |
< |
struct Client *to; |
863 |
< |
struct ConfItem *conf; |
864 |
< |
static char myname[HOSTLEN+1]; |
865 |
< |
dlink_node *ptr; |
863 |
> |
dlink_node *ptr = NULL; |
864 |
|
|
865 |
|
DLINK_FOREACH(ptr, serv_list.head) |
866 |
< |
{ |
867 |
< |
to = ptr->data; |
870 |
< |
|
871 |
< |
if ((conf = to->serv->sconf) != NULL) |
872 |
< |
strlcpy(myname, my_name_for_link(conf), sizeof(myname)); |
873 |
< |
else |
874 |
< |
strlcpy(myname, me.name, sizeof(myname)); |
875 |
< |
recurse_send_quits(source_p, source_p, from, to, |
876 |
< |
comment, splitstr, myname); |
877 |
< |
} |
866 |
> |
recurse_send_quits(source_p, source_p, from, ptr->data, |
867 |
> |
comment, splitstr); |
868 |
|
|
869 |
|
recurse_remove_clients(source_p, splitstr); |
870 |
|
} |
890 |
|
void |
891 |
|
exit_client(struct Client *source_p, struct Client *from, const char *comment) |
892 |
|
{ |
893 |
< |
dlink_node *m; |
893 |
> |
dlink_node *m = NULL; |
894 |
|
|
895 |
|
if (MyConnect(source_p)) |
896 |
|
{ |