123 |
|
int parc, char *parv[]) |
124 |
|
{ |
125 |
|
struct Client *target_p = NULL; |
126 |
< |
char *comment; |
127 |
< |
const char *server; |
128 |
< |
char def_reason[] = "No reason"; |
126 |
> |
const char *comment = NULL; |
127 |
|
|
128 |
< |
if (parc < 2 || EmptyString(parv[1])) |
128 |
> |
if (parc < 2 || EmptyString(parv[parc - 1])) |
129 |
|
return; |
130 |
|
|
131 |
< |
server = parv[1]; |
134 |
< |
|
135 |
< |
if ((target_p = hash_find_server(server)) == NULL) |
131 |
> |
if ((target_p = hash_find_server(parv[1])) == NULL) |
132 |
|
return; |
133 |
|
|
134 |
< |
if (!IsServer(target_p) || IsMe(target_p)) |
134 |
> |
if (!IsServer(target_p) && !IsMe(target_p)) |
135 |
|
return; |
136 |
|
|
137 |
< |
comment = (parc > 2 && parv[2]) ? parv[2] : def_reason; |
137 |
> |
if (IsMe(target_p)) |
138 |
> |
target_p = client_p; |
139 |
|
|
140 |
< |
if (strlen(comment) > (size_t)REASONLEN) |
144 |
< |
comment[REASONLEN] = '\0'; |
140 |
> |
comment = (parc > 2 && parv[parc - 1]) ? parv[parc - 1] : client_p->name; |
141 |
|
|
142 |
|
if (MyConnect(target_p)) |
143 |
|
{ |
151 |
|
me.name, target_p->name, source_p->name, comment); |
152 |
|
ilog(LOG_TYPE_IRCD, "SQUIT From %s : %s (%s)", source_p->name, |
153 |
|
target_p->name, comment); |
158 |
– |
|
154 |
|
} |
155 |
|
|
156 |
|
exit_client(target_p, source_p, comment); |