346 |
} |
} |
347 |
|
|
348 |
/* |
/* |
349 |
|
* irc_cmd_recv_kill: 'kill' message received |
350 |
|
*/ |
351 |
|
|
352 |
|
int |
353 |
|
irc_cmd_recv_kill (t_irc_server *server, char *host, char *arguments) |
354 |
|
{ |
355 |
|
char *pos, *pos_host2, *pos_comment; |
356 |
|
t_irc_channel *ptr_channel; |
357 |
|
|
358 |
|
pos = strchr (host, '!'); |
359 |
|
if (pos) |
360 |
|
pos[0] = '\0'; |
361 |
|
|
362 |
|
pos_host2 = strchr (arguments, ' '); |
363 |
|
if (pos_host2) |
364 |
|
{ |
365 |
|
pos_host2[0] = '\0'; |
366 |
|
pos_host2++; |
367 |
|
while (pos_host2[0] == ' ') |
368 |
|
pos_host2++; |
369 |
|
|
370 |
|
pos_comment = strchr (pos_host2, ' '); |
371 |
|
if (pos_comment) |
372 |
|
{ |
373 |
|
pos_comment[0] = '\0'; |
374 |
|
pos_comment++; |
375 |
|
while (pos_comment[0] == ' ') |
376 |
|
pos_comment++; |
377 |
|
if (pos_comment[0] == ':') |
378 |
|
pos_comment++; |
379 |
|
} |
380 |
|
|
381 |
|
for (ptr_channel = server->channels; ptr_channel; |
382 |
|
ptr_channel = ptr_channel->next_channel) |
383 |
|
{ |
384 |
|
irc_display_prefix (ptr_channel->buffer, PREFIX_PART); |
385 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK, |
386 |
|
"%s", host); |
387 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT, |
388 |
|
_(" has killed ")); |
389 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_NICK, |
390 |
|
"%s", arguments); |
391 |
|
if (pos_comment) |
392 |
|
{ |
393 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT, |
394 |
|
_(" from server")); |
395 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK, |
396 |
|
" ("); |
397 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT, |
398 |
|
"%s", pos_comment); |
399 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT_DARK, |
400 |
|
")\n"); |
401 |
|
} |
402 |
|
else |
403 |
|
gui_printf_color (ptr_channel->buffer, COLOR_WIN_CHAT, |
404 |
|
_(" from server\n")); |
405 |
|
} |
406 |
|
} |
407 |
|
else |
408 |
|
{ |
409 |
|
irc_display_prefix (server->buffer, PREFIX_ERROR); |
410 |
|
gui_printf_nolog (server->buffer, |
411 |
|
_("%s host \"%s\" not found for \"%s\" command\n"), |
412 |
|
WEECHAT_ERROR, "", "kill"); |
413 |
|
return -1; |
414 |
|
} |
415 |
|
return 0; |
416 |
|
} |
417 |
|
|
418 |
|
/* |
419 |
* irc_get_channel_modes: get channel modes |
* irc_get_channel_modes: get channel modes |
420 |
*/ |
*/ |
421 |
|
|