| 581 | | static void sig_exec_input(PROCESS_REC *rec, const char *text) |
| 582 | | { |
| 583 | | WI_ITEM_REC *item; |
| 584 | | SERVER_REC *server; |
| 585 | | char *str; |
| 586 | | |
| 587 | | if (rec->quiet) |
| 588 | | return; |
| 589 | | |
| 590 | | item = NULL;
|
| 591 | | server = NULL;
|
| 592 | | |
| 593 | | if (rec->target != NULL) {
|
| 594 | | if (rec->target_server != NULL) {
|
| 595 | | server = server_find_tag(rec->target_server); |
| 596 | | if (server == NULL) {
|
| 597 | | |
| 598 | | return; |
| 599 | | } |
| 600 | | item = NULL;
|
| 601 | | } else { |
| 602 | | item = window_item_find(NULL, rec->target);
|
| 603 | | server = item != NULL ? item->server :
|
| 604 | | active_win->active_server; |
| 605 | | } |
| 606 | | |
| 607 | | str = g_strconcat(rec->target_nick ? "-nick " : |
| 608 | | rec->target_channel ? "-channel " : "", |
| 609 | | rec->target, " ", text, NULL);
|
| 610 | | signal_emit(rec->notice ? "command notice" : "command msg", |
| 611 | | 3, str, server, item); |
| 612 | | g_free(str); |
| 613 | | } else if (rec->target_item != NULL) {
|
| 614 | | printtext(NULL, rec->target_item->visible_name,
|
| 615 | | rec->level, "%s", text); |
| 616 | | } else { |
| 617 | | printtext_window(rec->target_win, rec->level, "%s", text); |
| 618 | | } |
| 619 | | } |