| 306 |
|
sendto_one(struct Client *to, const char *pattern, ...) |
| 307 |
|
{ |
| 308 |
|
va_list args; |
| 309 |
< |
struct dbuf_block *buffer; |
| 310 |
< |
|
| 311 |
< |
to = to->from; |
| 309 |
> |
struct dbuf_block *buffer = NULL; |
| 310 |
|
|
| 311 |
< |
if (IsDead(to)) |
| 311 |
> |
if (IsDead(to->from)) |
| 312 |
|
return; /* This socket has already been marked as dead */ |
| 313 |
|
|
| 314 |
|
buffer = dbuf_alloc(); |
| 317 |
|
send_format(buffer, pattern, args); |
| 318 |
|
va_end(args); |
| 319 |
|
|
| 320 |
< |
send_message(to, buffer); |
| 320 |
> |
send_message(to->from, buffer); |
| 321 |
|
|
| 322 |
|
dbuf_ref_free(buffer); |
| 323 |
|
} |
| 325 |
|
void |
| 326 |
|
sendto_one_numeric(struct Client *to, struct Client *from, enum irc_numerics numeric, ...) |
| 327 |
|
{ |
| 328 |
< |
struct dbuf_block *buffer; |
| 328 |
> |
struct dbuf_block *buffer = NULL; |
| 329 |
> |
const char *dest = NULL; |
| 330 |
|
va_list args; |
| 332 |
– |
const char *dest; |
| 333 |
– |
|
| 334 |
– |
to = to->from; |
| 331 |
|
|
| 332 |
< |
if (IsDead(to)) |
| 332 |
> |
if (IsDead(to->from)) |
| 333 |
|
return; |
| 334 |
|
|
| 335 |
|
dest = ID_or_name(to, to); |
| 344 |
|
send_format(buffer, numeric_form(numeric), args); |
| 345 |
|
va_end(args); |
| 346 |
|
|
| 347 |
< |
send_message(to, buffer); |
| 347 |
> |
send_message(to->from, buffer); |
| 348 |
|
|
| 349 |
|
dbuf_ref_free(buffer); |
| 350 |
|
} |
| 352 |
|
void |
| 353 |
|
sendto_one_notice(struct Client *to, struct Client *from, const char *pattern, ...) |
| 354 |
|
{ |
| 355 |
< |
struct dbuf_block *buffer; |
| 355 |
> |
struct dbuf_block *buffer = NULL; |
| 356 |
> |
const char *dest = NULL; |
| 357 |
|
va_list args; |
| 361 |
– |
const char *dest; |
| 362 |
– |
|
| 363 |
– |
to = to->from; |
| 358 |
|
|
| 359 |
< |
if (IsDead(to)) |
| 359 |
> |
if (IsDead(to->from)) |
| 360 |
|
return; |
| 361 |
|
|
| 362 |
|
dest = ID_or_name(to, to); |
| 371 |
|
send_format(buffer, pattern, args); |
| 372 |
|
va_end(args); |
| 373 |
|
|
| 374 |
< |
send_message(to, buffer); |
| 374 |
> |
send_message(to->from, buffer); |
| 375 |
|
|
| 376 |
|
dbuf_ref_free(buffer); |
| 377 |
|
} |
| 818 |
|
const char *pattern, ...) |
| 819 |
|
{ |
| 820 |
|
va_list args; |
| 821 |
< |
struct dbuf_block *buffer; |
| 821 |
> |
struct dbuf_block *buffer = NULL; |
| 822 |
|
|
| 823 |
|
if (IsDead(to->from)) |
| 824 |
|
return; |
| 825 |
|
|
| 826 |
|
buffer = dbuf_alloc(); |
| 827 |
|
|
| 828 |
< |
if (MyClient(to)) |
| 829 |
< |
{ |
| 830 |
< |
if (IsServer(from)) |
| 837 |
< |
dbuf_put_fmt(buffer, ":%s %s %s ", from->name, command, to->name); |
| 838 |
< |
else |
| 839 |
< |
dbuf_put_fmt(buffer, ":%s!%s@%s %s %s ", from->name, from->username, from->host, command, to->name); |
| 840 |
< |
} |
| 828 |
> |
if (MyClient(to) && IsClient(from)) |
| 829 |
> |
dbuf_put_fmt(buffer, ":%s!%s@%s %s %s ", from->name, from->username, |
| 830 |
> |
from->host, command, to->name); |
| 831 |
|
else |
| 832 |
< |
dbuf_put_fmt(buffer, ":%s %s %s ", ID_or_name(from, to), command, ID_or_name(to, to)); |
| 832 |
> |
dbuf_put_fmt(buffer, ":%s %s %s ", ID_or_name(from, to), |
| 833 |
> |
command, ID_or_name(to, to)); |
| 834 |
|
|
| 835 |
|
va_start(args, pattern); |
| 836 |
|
send_format(buffer, pattern, args); |