285 |
|
|
286 |
if (weelist_search (index_commands, alias_name)) |
if (weelist_search (index_commands, alias_name)) |
287 |
{ |
{ |
288 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
289 |
gui_printf (NULL, _("%s alias or command \"%s\" already exists!\n"), |
gui_printf (NULL, _("%s alias or command \"%s\" already exists!\n"), |
290 |
WEECHAT_ERROR, alias_name); |
WEECHAT_ERROR, alias_name); |
291 |
return NULL; |
return NULL; |
295 |
pos[0] = '\0'; |
pos[0] = '\0'; |
296 |
if (alias_search (alias_command)) |
if (alias_search (alias_command)) |
297 |
{ |
{ |
298 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
299 |
gui_printf (NULL, _("%s alias cannot run another alias!\n"), |
gui_printf (NULL, _("%s alias cannot run another alias!\n"), |
300 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
301 |
return NULL; |
return NULL; |
302 |
} |
} |
303 |
if (!weelist_search (index_commands, alias_command)) |
if (!weelist_search (index_commands, alias_command)) |
304 |
{ |
{ |
305 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
306 |
gui_printf (NULL, _("%s target command \"%s\" does not exist!\n"), |
gui_printf (NULL, _("%s target command \"%s\" does not exist!\n"), |
307 |
WEECHAT_ERROR, alias_command); |
WEECHAT_ERROR, alias_command); |
308 |
return NULL; |
return NULL; |
530 |
if (weechat_commands[i].min_arg == |
if (weechat_commands[i].min_arg == |
531 |
weechat_commands[i].max_arg) |
weechat_commands[i].max_arg) |
532 |
{ |
{ |
533 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
534 |
gui_printf (NULL, |
gui_printf (NULL, |
535 |
_("%s wrong argument count for %s command \"%s\" " |
_("%s wrong argument count for %s command \"%s\" " |
536 |
"(expected: %d arg%s)\n"), |
"(expected: %d arg%s)\n"), |
542 |
} |
} |
543 |
else |
else |
544 |
{ |
{ |
545 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
546 |
gui_printf (NULL, |
gui_printf (NULL, |
547 |
_("%s wrong argument count for %s command \"%s\" " |
_("%s wrong argument count for %s command \"%s\" " |
548 |
"(expected: between %d and %d arg%s)\n"), |
"(expected: between %d and %d arg%s)\n"), |
564 |
(ptr_args); |
(ptr_args); |
565 |
if (return_code < 0) |
if (return_code < 0) |
566 |
{ |
{ |
567 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
568 |
gui_printf (NULL, |
gui_printf (NULL, |
569 |
_("%s command \"%s\" failed\n"), |
_("%s command \"%s\" failed\n"), |
570 |
WEECHAT_ERROR, command + 1); |
WEECHAT_ERROR, command + 1); |
586 |
{ |
{ |
587 |
if (irc_commands[i].min_arg == irc_commands[i].max_arg) |
if (irc_commands[i].min_arg == irc_commands[i].max_arg) |
588 |
{ |
{ |
589 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
590 |
gui_printf |
gui_printf |
591 |
(NULL, |
(NULL, |
592 |
_("%s wrong argument count for IRC command \"%s\" " |
_("%s wrong argument count for IRC command \"%s\" " |
598 |
} |
} |
599 |
else |
else |
600 |
{ |
{ |
601 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
602 |
gui_printf |
gui_printf |
603 |
(NULL, |
(NULL, |
604 |
_("%s wrong argument count for IRC command \"%s\" " |
_("%s wrong argument count for IRC command \"%s\" " |
614 |
if ((irc_commands[i].need_connection) && |
if ((irc_commands[i].need_connection) && |
615 |
((!server) || (!server->is_connected))) |
((!server) || (!server->is_connected))) |
616 |
{ |
{ |
617 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
618 |
gui_printf (NULL, |
gui_printf (NULL, |
619 |
_("%s command \"%s\" needs a server connection!\n"), |
_("%s command \"%s\" needs a server connection!\n"), |
620 |
WEECHAT_ERROR, irc_commands[i].command_name); |
WEECHAT_ERROR, irc_commands[i].command_name); |
629 |
(server, ptr_args); |
(server, ptr_args); |
630 |
if (return_code < 0) |
if (return_code < 0) |
631 |
{ |
{ |
632 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
633 |
gui_printf (NULL, |
gui_printf (NULL, |
634 |
_("%s command \"%s\" failed\n"), |
_("%s command \"%s\" failed\n"), |
635 |
WEECHAT_ERROR, command + 1); |
WEECHAT_ERROR, command + 1); |
668 |
return 1; |
return 1; |
669 |
} |
} |
670 |
} |
} |
671 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
672 |
gui_printf (NULL, |
gui_printf (NULL, |
673 |
_("%s unknown command \"%s\" (type /help for help)\n"), |
_("%s unknown command \"%s\" (type /help for help)\n"), |
674 |
WEECHAT_ERROR, |
WEECHAT_ERROR, |
744 |
} |
} |
745 |
else |
else |
746 |
{ |
{ |
747 |
irc_display_prefix (server->buffer, PREFIX_ERROR); |
irc_display_prefix (server, server->buffer, PREFIX_ERROR); |
748 |
gui_printf (server->buffer, |
gui_printf (server->buffer, |
749 |
_("%s cannot find nick for sending message\n"), |
_("%s cannot find nick for sending message\n"), |
750 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
768 |
} |
} |
769 |
else |
else |
770 |
{ |
{ |
771 |
irc_display_prefix (server->buffer, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
772 |
gui_printf (server->buffer, |
gui_printf (NULL, |
773 |
_("%s unable to call handler for message (not enough memory)\n"), |
_("%s unable to call handler for message (not enough memory)\n"), |
774 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
775 |
} |
} |
776 |
} |
} |
777 |
else |
else |
778 |
{ |
{ |
779 |
irc_display_prefix ((server) ? server->buffer : NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, (server) ? server->buffer : NULL, PREFIX_ERROR); |
780 |
gui_printf_nolog ((server) ? server->buffer : NULL, |
gui_printf_nolog ((server) ? server->buffer : NULL, |
781 |
_("This window is not a channel!\n")); |
_("This window is not a channel!\n")); |
782 |
} |
} |
805 |
pos++; |
pos++; |
806 |
if (!pos[0]) |
if (!pos[0]) |
807 |
{ |
{ |
808 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
809 |
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"), |
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"), |
810 |
WEECHAT_ERROR, "alias"); |
WEECHAT_ERROR, "alias"); |
811 |
return -1; |
return -1; |
814 |
return -1; |
return -1; |
815 |
if (weelist_add (&index_commands, &last_index_command, arguments)) |
if (weelist_add (&index_commands, &last_index_command, arguments)) |
816 |
{ |
{ |
817 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
818 |
gui_printf (NULL, _("Alias \"%s\" => \"%s\" created\n"), |
gui_printf (NULL, _("Alias \"%s\" => \"%s\" created\n"), |
819 |
arguments, pos); |
arguments, pos); |
820 |
} |
} |
821 |
else |
else |
822 |
{ |
{ |
823 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
824 |
gui_printf (NULL, _("Failed to create alias \"%s\" => \"%s\" " |
gui_printf (NULL, _("Failed to create alias \"%s\" => \"%s\" " |
825 |
"(not enough memory)\n"), |
"(not enough memory)\n"), |
826 |
arguments, pos); |
arguments, pos); |
829 |
} |
} |
830 |
else |
else |
831 |
{ |
{ |
832 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
833 |
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"), |
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"), |
834 |
WEECHAT_ERROR, "alias"); |
WEECHAT_ERROR, "alias"); |
835 |
return -1; |
return -1; |
852 |
} |
} |
853 |
else |
else |
854 |
{ |
{ |
855 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
856 |
gui_printf (NULL, _("No alias defined.\n")); |
gui_printf (NULL, _("No alias defined.\n")); |
857 |
} |
} |
858 |
} |
} |
939 |
|
|
940 |
if (argc < 2) |
if (argc < 2) |
941 |
{ |
{ |
942 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
943 |
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"), |
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"), |
944 |
WEECHAT_ERROR, "buffer"); |
WEECHAT_ERROR, "buffer"); |
945 |
return -1; |
return -1; |
962 |
else |
else |
963 |
{ |
{ |
964 |
/* invalid number */ |
/* invalid number */ |
965 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
966 |
gui_printf (NULL, _("%s incorrect buffer number\n"), |
gui_printf (NULL, _("%s incorrect buffer number\n"), |
967 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
968 |
return -1; |
return -1; |
973 |
/* close buffer (server or channel/private) */ |
/* close buffer (server or channel/private) */ |
974 |
|
|
975 |
if ((!gui_current_window->buffer->next_buffer) |
if ((!gui_current_window->buffer->next_buffer) |
976 |
&& (gui_current_window->buffer == gui_buffers)) |
&& (gui_current_window->buffer == gui_buffers) |
977 |
|
&& ((!gui_current_window->buffer->all_servers) |
978 |
|
|| (!SERVER(gui_current_window->buffer)))) |
979 |
{ |
{ |
980 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
981 |
gui_printf (NULL, |
gui_printf (NULL, |
982 |
_("%s can not close the single buffer\n"), |
_("%s can not close the single buffer\n"), |
983 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
987 |
{ |
{ |
988 |
if (SERVER(gui_current_window->buffer)->channels) |
if (SERVER(gui_current_window->buffer)->channels) |
989 |
{ |
{ |
990 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
991 |
gui_printf (NULL, |
gui_printf (NULL, |
992 |
_("%s can not close server buffer while channels " |
_("%s can not close server buffer while channels " |
993 |
"are opened\n"), |
"are opened\n"), |
996 |
} |
} |
997 |
server_disconnect (SERVER(gui_current_window->buffer), 0); |
server_disconnect (SERVER(gui_current_window->buffer), 0); |
998 |
ptr_server = SERVER(gui_current_window->buffer); |
ptr_server = SERVER(gui_current_window->buffer); |
999 |
gui_buffer_free (gui_current_window->buffer, 1); |
if (!gui_current_window->buffer->all_servers) |
1000 |
ptr_server->buffer = NULL; |
{ |
1001 |
|
gui_buffer_free (gui_current_window->buffer, 1); |
1002 |
|
ptr_server->buffer = NULL; |
1003 |
|
} |
1004 |
|
else |
1005 |
|
{ |
1006 |
|
ptr_server->buffer = NULL; |
1007 |
|
gui_current_window->buffer->server = NULL; |
1008 |
|
gui_window_switch_server (gui_current_window); |
1009 |
|
} |
1010 |
|
|
1011 |
} |
} |
1012 |
else |
else |
1013 |
{ |
{ |
1067 |
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX)) |
if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX)) |
1068 |
{ |
{ |
1069 |
/* invalid highlight level */ |
/* invalid highlight level */ |
1070 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1071 |
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"), |
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"), |
1072 |
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX); |
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX); |
1073 |
return -1; |
return -1; |
1076 |
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer))) |
&& (!BUFFER_IS_PRIVATE(gui_current_window->buffer))) |
1077 |
{ |
{ |
1078 |
/* invalid buffer type (only ok on channel or private) */ |
/* invalid buffer type (only ok on channel or private) */ |
1079 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1080 |
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"), |
gui_printf (NULL, _("%s incorrect buffer for notify (must be channel or private)\n"), |
1081 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
1082 |
return -1; |
return -1; |
1089 |
else |
else |
1090 |
{ |
{ |
1091 |
/* invalid number */ |
/* invalid number */ |
1092 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1093 |
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"), |
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"), |
1094 |
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX); |
WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX); |
1095 |
return -1; |
return -1; |
1155 |
gui_buffer_clear_all (); |
gui_buffer_clear_all (); |
1156 |
else |
else |
1157 |
{ |
{ |
1158 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1159 |
gui_printf (NULL, |
gui_printf (NULL, |
1160 |
_("unknown parameter \"%s\" for \"%s\" command\n"), |
_("unknown parameter \"%s\" for \"%s\" command\n"), |
1161 |
argv[0], "clear"); |
argv[0], "clear"); |
1185 |
{ |
{ |
1186 |
if (ptr_server->is_connected) |
if (ptr_server->is_connected) |
1187 |
{ |
{ |
1188 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1189 |
gui_printf (NULL, |
gui_printf (NULL, |
1190 |
_("%s already connected to server \"%s\"!\n"), |
_("%s already connected to server \"%s\"!\n"), |
1191 |
WEECHAT_ERROR, ptr_server->name); |
WEECHAT_ERROR, ptr_server->name); |
1193 |
} |
} |
1194 |
if (ptr_server->child_pid > 0) |
if (ptr_server->child_pid > 0) |
1195 |
{ |
{ |
1196 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1197 |
gui_printf (NULL, |
gui_printf (NULL, |
1198 |
_("%s currently connecting to server \"%s\"!\n"), |
_("%s currently connecting to server \"%s\"!\n"), |
1199 |
WEECHAT_ERROR, ptr_server->name); |
WEECHAT_ERROR, ptr_server->name); |
1212 |
} |
} |
1213 |
else |
else |
1214 |
{ |
{ |
1215 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1216 |
gui_printf (NULL, _("%s server not found\n"), WEECHAT_ERROR); |
gui_printf (NULL, _("%s server not found\n"), WEECHAT_ERROR); |
1217 |
return -1; |
return -1; |
1218 |
} |
} |
1228 |
{ |
{ |
1229 |
if (argc != 1) |
if (argc != 1) |
1230 |
{ |
{ |
1231 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1232 |
gui_printf (NULL, |
gui_printf (NULL, |
1233 |
_("%s wrong argument count for \"%s\" command\n"), |
_("%s wrong argument count for \"%s\" command\n"), |
1234 |
WEECHAT_ERROR, "debug"); |
WEECHAT_ERROR, "debug"); |
1241 |
} |
} |
1242 |
else |
else |
1243 |
{ |
{ |
1244 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1245 |
gui_printf (NULL, |
gui_printf (NULL, |
1246 |
_("%s unknown option for \"%s\" command\n"), |
_("%s unknown option for \"%s\" command\n"), |
1247 |
WEECHAT_ERROR, "debug"); |
WEECHAT_ERROR, "debug"); |
1270 |
if ((!ptr_server->is_connected) && (ptr_server->child_pid == 0) |
if ((!ptr_server->is_connected) && (ptr_server->child_pid == 0) |
1271 |
&& (ptr_server->reconnect_start == 0)) |
&& (ptr_server->reconnect_start == 0)) |
1272 |
{ |
{ |
1273 |
irc_display_prefix (ptr_server->buffer, PREFIX_ERROR); |
irc_display_prefix (NULL, ptr_server->buffer, PREFIX_ERROR); |
1274 |
gui_printf (ptr_server->buffer, |
gui_printf (ptr_server->buffer, |
1275 |
_("%s not connected to server \"%s\"!\n"), |
_("%s not connected to server \"%s\"!\n"), |
1276 |
WEECHAT_ERROR, ptr_server->name); |
WEECHAT_ERROR, ptr_server->name); |
1278 |
} |
} |
1279 |
if (ptr_server->reconnect_start > 0) |
if (ptr_server->reconnect_start > 0) |
1280 |
{ |
{ |
1281 |
irc_display_prefix (ptr_server->buffer, PREFIX_INFO); |
irc_display_prefix (NULL, ptr_server->buffer, PREFIX_INFO); |
1282 |
gui_printf (ptr_server->buffer, |
gui_printf (ptr_server->buffer, |
1283 |
_("Auto-reconnection is cancelled\n")); |
_("Auto-reconnection is cancelled\n")); |
1284 |
} |
} |
1287 |
} |
} |
1288 |
else |
else |
1289 |
{ |
{ |
1290 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1291 |
gui_printf (NULL, _("%s server not found\n"), WEECHAT_ERROR); |
gui_printf (NULL, _("%s server not found\n"), WEECHAT_ERROR); |
1292 |
return -1; |
return -1; |
1293 |
} |
} |
1439 |
} |
} |
1440 |
} |
} |
1441 |
#endif |
#endif |
1442 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1443 |
gui_printf (NULL, |
gui_printf (NULL, |
1444 |
_("No help available, \"%s\" is an unknown command\n"), |
_("No help available, \"%s\" is an unknown command\n"), |
1445 |
argv[0]); |
argv[0]); |
1501 |
} |
} |
1502 |
else |
else |
1503 |
{ |
{ |
1504 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
1505 |
gui_printf (NULL, _("No ignore defined.\n")); |
gui_printf (NULL, _("No ignore defined.\n")); |
1506 |
} |
} |
1507 |
return 0; |
return 0; |
1595 |
gui_printf (NULL, _("Key \"%s\" unbinded\n"), arguments); |
gui_printf (NULL, _("Key \"%s\" unbinded\n"), arguments); |
1596 |
else |
else |
1597 |
{ |
{ |
1598 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1599 |
gui_printf (NULL, |
gui_printf (NULL, |
1600 |
_("%s unable to unbind key \"%s\"\n"), |
_("%s unable to unbind key \"%s\"\n"), |
1601 |
WEECHAT_ERROR, arguments); |
WEECHAT_ERROR, arguments); |
1628 |
} |
} |
1629 |
else |
else |
1630 |
{ |
{ |
1631 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1632 |
gui_printf (NULL, |
gui_printf (NULL, |
1633 |
_("%s \"-yes\" argument is required for keys reset (securuty reason)\n"), |
_("%s \"-yes\" argument is required for keys reset (securuty reason)\n"), |
1634 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
1642 |
pos = strchr (arguments, ' '); |
pos = strchr (arguments, ' '); |
1643 |
if (!pos) |
if (!pos) |
1644 |
{ |
{ |
1645 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1646 |
gui_printf (NULL, |
gui_printf (NULL, |
1647 |
_("%s wrong argument count for \"%s\" command\n"), |
_("%s wrong argument count for \"%s\" command\n"), |
1648 |
WEECHAT_ERROR, "key"); |
WEECHAT_ERROR, "key"); |
1657 |
weechat_cmd_key_display (ptr_key, 1); |
weechat_cmd_key_display (ptr_key, 1); |
1658 |
else |
else |
1659 |
{ |
{ |
1660 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1661 |
gui_printf (NULL, |
gui_printf (NULL, |
1662 |
_("%s unable to bind key \"%s\"\n"), |
_("%s unable to bind key \"%s\"\n"), |
1663 |
WEECHAT_ERROR, arguments); |
WEECHAT_ERROR, arguments); |
1685 |
case 0: |
case 0: |
1686 |
/* list plugins */ |
/* list plugins */ |
1687 |
gui_printf (NULL, "\n"); |
gui_printf (NULL, "\n"); |
1688 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1689 |
gui_printf (NULL, _("Plugins loaded:\n")); |
gui_printf (NULL, _("Plugins loaded:\n")); |
1690 |
for (ptr_plugin = weechat_plugins; ptr_plugin; |
for (ptr_plugin = weechat_plugins; ptr_plugin; |
1691 |
ptr_plugin = ptr_plugin->next_plugin) |
ptr_plugin = ptr_plugin->next_plugin) |
1692 |
{ |
{ |
1693 |
/* plugin info */ |
/* plugin info */ |
1694 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1695 |
gui_printf (NULL, " %s v%s - %s (%s)\n", |
gui_printf (NULL, " %s v%s - %s (%s)\n", |
1696 |
ptr_plugin->name, |
ptr_plugin->name, |
1697 |
ptr_plugin->version, |
ptr_plugin->version, |
1699 |
ptr_plugin->filename); |
ptr_plugin->filename); |
1700 |
|
|
1701 |
/* message handlers */ |
/* message handlers */ |
1702 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1703 |
gui_printf (NULL, _(" message handlers:\n")); |
gui_printf (NULL, _(" message handlers:\n")); |
1704 |
handler_found = 0; |
handler_found = 0; |
1705 |
for (ptr_handler = ptr_plugin->handlers; |
for (ptr_handler = ptr_plugin->handlers; |
1708 |
if (ptr_handler->type == HANDLER_MESSAGE) |
if (ptr_handler->type == HANDLER_MESSAGE) |
1709 |
{ |
{ |
1710 |
handler_found = 1; |
handler_found = 1; |
1711 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1712 |
gui_printf (NULL, _(" IRC(%s)\n"), |
gui_printf (NULL, _(" IRC(%s)\n"), |
1713 |
ptr_handler->irc_command); |
ptr_handler->irc_command); |
1714 |
} |
} |
1715 |
} |
} |
1716 |
if (!handler_found) |
if (!handler_found) |
1717 |
{ |
{ |
1718 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1719 |
gui_printf (NULL, _(" (no message handler)\n")); |
gui_printf (NULL, _(" (no message handler)\n")); |
1720 |
} |
} |
1721 |
|
|
1722 |
/* command handlers */ |
/* command handlers */ |
1723 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1724 |
gui_printf (NULL, _(" command handlers:\n")); |
gui_printf (NULL, _(" command handlers:\n")); |
1725 |
handler_found = 0; |
handler_found = 0; |
1726 |
for (ptr_handler = ptr_plugin->handlers; |
for (ptr_handler = ptr_plugin->handlers; |
1729 |
if (ptr_handler->type == HANDLER_COMMAND) |
if (ptr_handler->type == HANDLER_COMMAND) |
1730 |
{ |
{ |
1731 |
handler_found = 1; |
handler_found = 1; |
1732 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1733 |
gui_printf (NULL, " /%s", |
gui_printf (NULL, " /%s", |
1734 |
ptr_handler->command); |
ptr_handler->command); |
1735 |
if (ptr_handler->description |
if (ptr_handler->description |
1741 |
} |
} |
1742 |
if (!handler_found) |
if (!handler_found) |
1743 |
{ |
{ |
1744 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1745 |
gui_printf (NULL, _(" (no command handler)\n")); |
gui_printf (NULL, _(" (no command handler)\n")); |
1746 |
} |
} |
1747 |
} |
} |
1748 |
if (!weechat_plugins) |
if (!weechat_plugins) |
1749 |
{ |
{ |
1750 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
1751 |
gui_printf (NULL, _(" (no plugin)\n")); |
gui_printf (NULL, _(" (no plugin)\n")); |
1752 |
} |
} |
1753 |
break; |
break; |
1769 |
plugin_unload_name (argv[1]); |
plugin_unload_name (argv[1]); |
1770 |
else |
else |
1771 |
{ |
{ |
1772 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1773 |
gui_printf (NULL, |
gui_printf (NULL, |
1774 |
_("%s unknown option for \"%s\" command\n"), |
_("%s unknown option for \"%s\" command\n"), |
1775 |
WEECHAT_ERROR, "plugin"); |
WEECHAT_ERROR, "plugin"); |
1776 |
} |
} |
1777 |
break; |
break; |
1778 |
default: |
default: |
1779 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1780 |
gui_printf (NULL, |
gui_printf (NULL, |
1781 |
_("%s wrong argument count for \"%s\" command\n"), |
_("%s wrong argument count for \"%s\" command\n"), |
1782 |
WEECHAT_ERROR, "plugin"); |
WEECHAT_ERROR, "plugin"); |
1783 |
} |
} |
1784 |
#else |
#else |
1785 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1786 |
gui_printf (NULL, |
gui_printf (NULL, |
1787 |
_("Command \"plugin\" is not available, WeeChat was built " |
_("Command \"plugin\" is not available, WeeChat was built " |
1788 |
"without plugins support.\n")); |
"without plugins support.\n")); |
1830 |
} |
} |
1831 |
else |
else |
1832 |
{ |
{ |
1833 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
1834 |
gui_printf (NULL, _("No server.\n")); |
gui_printf (NULL, _("No server.\n")); |
1835 |
} |
} |
1836 |
} |
} |
1841 |
irc_display_server (ptr_server); |
irc_display_server (ptr_server); |
1842 |
else |
else |
1843 |
{ |
{ |
1844 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
1845 |
gui_printf (NULL, _("Server '%s' not found.\n"), argv[0]); |
gui_printf (NULL, _("Server '%s' not found.\n"), argv[0]); |
1846 |
} |
} |
1847 |
} |
} |
1852 |
{ |
{ |
1853 |
if (argc < 2) |
if (argc < 2) |
1854 |
{ |
{ |
1855 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1856 |
gui_printf (NULL, |
gui_printf (NULL, |
1857 |
_("%s missing servername for \"%s\" command\n"), |
_("%s missing servername for \"%s\" command\n"), |
1858 |
WEECHAT_ERROR, "server del"); |
WEECHAT_ERROR, "server del"); |
1860 |
} |
} |
1861 |
if (argc > 2) |
if (argc > 2) |
1862 |
{ |
{ |
1863 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1864 |
gui_printf (NULL, |
gui_printf (NULL, |
1865 |
_("%s too much arguments for \"%s\" command, ignoring arguments\n"), |
_("%s too much arguments for \"%s\" command, ignoring arguments\n"), |
1866 |
WEECHAT_WARNING, "server del"); |
WEECHAT_WARNING, "server del"); |
1879 |
} |
} |
1880 |
if (!server_found) |
if (!server_found) |
1881 |
{ |
{ |
1882 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1883 |
gui_printf (NULL, |
gui_printf (NULL, |
1884 |
_("%s server \"%s\" not found for \"%s\" command\n"), |
_("%s server \"%s\" not found for \"%s\" command\n"), |
1885 |
WEECHAT_ERROR, argv[1], "server del"); |
WEECHAT_ERROR, argv[1], "server del"); |
1887 |
} |
} |
1888 |
if (server_found->is_connected) |
if (server_found->is_connected) |
1889 |
{ |
{ |
1890 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1891 |
gui_printf (NULL, |
gui_printf (NULL, |
1892 |
_("%s you can not delete server \"%s\" because you are connected to. " |
_("%s you can not delete server \"%s\" because you are connected to. " |
1893 |
"Try /disconnect %s before.\n"), |
"Try /disconnect %s before.\n"), |
1904 |
} |
} |
1905 |
} |
} |
1906 |
|
|
1907 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
1908 |
gui_printf_color (NULL, COLOR_WIN_CHAT, _("Server")); |
gui_printf_color (NULL, COLOR_WIN_CHAT, _("Server")); |
1909 |
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, |
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, |
1910 |
" %s ", server_found->name); |
" %s ", server_found->name); |
1921 |
|
|
1922 |
if (argc < 3) |
if (argc < 3) |
1923 |
{ |
{ |
1924 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1925 |
gui_printf (NULL, |
gui_printf (NULL, |
1926 |
_("%s missing parameters for \"%s\" command\n"), |
_("%s missing parameters for \"%s\" command\n"), |
1927 |
WEECHAT_ERROR, "server"); |
WEECHAT_ERROR, "server"); |
1931 |
|
|
1932 |
if (server_name_already_exists (argv[0])) |
if (server_name_already_exists (argv[0])) |
1933 |
{ |
{ |
1934 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1935 |
gui_printf (NULL, |
gui_printf (NULL, |
1936 |
_("%s server \"%s\" already exists, can't create it!\n"), |
_("%s server \"%s\" already exists, can't create it!\n"), |
1937 |
WEECHAT_ERROR, argv[0]); |
WEECHAT_ERROR, argv[0]); |
1960 |
{ |
{ |
1961 |
if (i == (argc - 1)) |
if (i == (argc - 1)) |
1962 |
{ |
{ |
1963 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1964 |
gui_printf (NULL, |
gui_printf (NULL, |
1965 |
_("%s missing password for \"%s\" parameter\n"), |
_("%s missing password for \"%s\" parameter\n"), |
1966 |
WEECHAT_ERROR, "-pwd"); |
WEECHAT_ERROR, "-pwd"); |
1973 |
{ |
{ |
1974 |
if (i >= (argc - 3)) |
if (i >= (argc - 3)) |
1975 |
{ |
{ |
1976 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1977 |
gui_printf (NULL, |
gui_printf (NULL, |
1978 |
_("%s missing nick(s) for \"%s\" parameter\n"), |
_("%s missing nick(s) for \"%s\" parameter\n"), |
1979 |
WEECHAT_ERROR, "-nicks"); |
WEECHAT_ERROR, "-nicks"); |
1988 |
{ |
{ |
1989 |
if (i == (argc - 1)) |
if (i == (argc - 1)) |
1990 |
{ |
{ |
1991 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
1992 |
gui_printf (NULL, |
gui_printf (NULL, |
1993 |
_("%s missing password for \"%s\" parameter\n"), |
_("%s missing password for \"%s\" parameter\n"), |
1994 |
WEECHAT_ERROR, "-username"); |
WEECHAT_ERROR, "-username"); |
2001 |
{ |
{ |
2002 |
if (i == (argc - 1)) |
if (i == (argc - 1)) |
2003 |
{ |
{ |
2004 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2005 |
gui_printf (NULL, |
gui_printf (NULL, |
2006 |
_("%s missing password for \"%s\" parameter\n"), |
_("%s missing password for \"%s\" parameter\n"), |
2007 |
WEECHAT_ERROR, "-realname"); |
WEECHAT_ERROR, "-realname"); |
2014 |
{ |
{ |
2015 |
if (i == (argc - 1)) |
if (i == (argc - 1)) |
2016 |
{ |
{ |
2017 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2018 |
gui_printf (NULL, |
gui_printf (NULL, |
2019 |
_("%s missing command for \"%s\" parameter\n"), |
_("%s missing command for \"%s\" parameter\n"), |
2020 |
WEECHAT_ERROR, "-command"); |
WEECHAT_ERROR, "-command"); |
2027 |
{ |
{ |
2028 |
if (i == (argc - 1)) |
if (i == (argc - 1)) |
2029 |
{ |
{ |
2030 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2031 |
gui_printf (NULL, |
gui_printf (NULL, |
2032 |
_("%s missing password for \"%s\" parameter\n"), |
_("%s missing password for \"%s\" parameter\n"), |
2033 |
WEECHAT_ERROR, "-autojoin"); |
WEECHAT_ERROR, "-autojoin"); |
2050 |
server.command, 1, server.autojoin, 1, NULL); |
server.command, 1, server.autojoin, 1, NULL); |
2051 |
if (new_server) |
if (new_server) |
2052 |
{ |
{ |
2053 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
2054 |
gui_printf_color (NULL, COLOR_WIN_CHAT, _("Server")); |
gui_printf_color (NULL, COLOR_WIN_CHAT, _("Server")); |
2055 |
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, |
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, |
2056 |
" %s ", server.name); |
" %s ", server.name); |
2058 |
} |
} |
2059 |
else |
else |
2060 |
{ |
{ |
2061 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2062 |
gui_printf (NULL, |
gui_printf (NULL, |
2063 |
_("%s unable to create server\n"), |
_("%s unable to create server\n"), |
2064 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
2200 |
ptr_server = server_search (option); |
ptr_server = server_search (option); |
2201 |
if (!ptr_server) |
if (!ptr_server) |
2202 |
{ |
{ |
2203 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2204 |
gui_printf (NULL, |
gui_printf (NULL, |
2205 |
_("%s server \"%s\" not found\n"), |
_("%s server \"%s\" not found\n"), |
2206 |
WEECHAT_ERROR, option); |
WEECHAT_ERROR, option); |
2232 |
config_change_buffer_content (); |
config_change_buffer_content (); |
2233 |
break; |
break; |
2234 |
case -1: |
case -1: |
2235 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2236 |
gui_printf (NULL, _("%s config option \"%s\" not found\n"), |
gui_printf (NULL, _("%s config option \"%s\" not found\n"), |
2237 |
WEECHAT_ERROR, pos + 1); |
WEECHAT_ERROR, pos + 1); |
2238 |
break; |
break; |
2239 |
case -2: |
case -2: |
2240 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2241 |
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"), |
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"), |
2242 |
WEECHAT_ERROR, pos + 1); |
WEECHAT_ERROR, pos + 1); |
2243 |
break; |
break; |
2252 |
{ |
{ |
2253 |
if (ptr_option->handler_change == NULL) |
if (ptr_option->handler_change == NULL) |
2254 |
{ |
{ |
2255 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2256 |
gui_printf (NULL, |
gui_printf (NULL, |
2257 |
_("%s option \"%s\" can not be changed while WeeChat is running\n"), |
_("%s option \"%s\" can not be changed while WeeChat is running\n"), |
2258 |
WEECHAT_ERROR, option); |
WEECHAT_ERROR, option); |
2270 |
} |
} |
2271 |
else |
else |
2272 |
{ |
{ |
2273 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2274 |
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"), |
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"), |
2275 |
WEECHAT_ERROR, option); |
WEECHAT_ERROR, option); |
2276 |
} |
} |
2278 |
} |
} |
2279 |
else |
else |
2280 |
{ |
{ |
2281 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2282 |
gui_printf (NULL, _("%s config option \"%s\" not found\n"), |
gui_printf (NULL, _("%s config option \"%s\" not found\n"), |
2283 |
WEECHAT_ERROR, option); |
WEECHAT_ERROR, option); |
2284 |
} |
} |
2444 |
ptr_weelist = weelist_search (index_commands, arguments); |
ptr_weelist = weelist_search (index_commands, arguments); |
2445 |
if (!ptr_weelist) |
if (!ptr_weelist) |
2446 |
{ |
{ |
2447 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2448 |
gui_printf (NULL, _("%s alias or command \"%s\" not found\n"), |
gui_printf (NULL, _("%s alias or command \"%s\" not found\n"), |
2449 |
WEECHAT_ERROR, arguments); |
WEECHAT_ERROR, arguments); |
2450 |
return -1; |
return -1; |
2454 |
ptr_alias = alias_search (arguments); |
ptr_alias = alias_search (arguments); |
2455 |
if (ptr_alias) |
if (ptr_alias) |
2456 |
alias_free (ptr_alias); |
alias_free (ptr_alias); |
2457 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
2458 |
gui_printf (NULL, _("Alias \"%s\" removed\n"), |
gui_printf (NULL, _("Alias \"%s\" removed\n"), |
2459 |
arguments); |
arguments); |
2460 |
return 0; |
return 0; |
2505 |
|
|
2506 |
if (ret) |
if (ret) |
2507 |
{ |
{ |
2508 |
irc_display_prefix (NULL, PREFIX_INFO); |
irc_display_prefix (NULL, NULL, PREFIX_INFO); |
2509 |
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%d ", ret); |
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL, "%d ", ret); |
2510 |
if (ret > 1) |
if (ret > 1) |
2511 |
gui_printf (NULL, _("ignore were removed.\n")); |
gui_printf (NULL, _("ignore were removed.\n")); |
2514 |
} |
} |
2515 |
else |
else |
2516 |
{ |
{ |
2517 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2518 |
gui_printf (NULL, _("%s no ignore found\n"), |
gui_printf (NULL, _("%s no ignore found\n"), |
2519 |
WEECHAT_ERROR); |
WEECHAT_ERROR); |
2520 |
return -1; |
return -1; |
2590 |
gui_window_merge_all (gui_current_window); |
gui_window_merge_all (gui_current_window); |
2591 |
else |
else |
2592 |
{ |
{ |
2593 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2594 |
gui_printf (NULL, |
gui_printf (NULL, |
2595 |
_("%s unknown option for \"%s\" command\n"), |
_("%s unknown option for \"%s\" command\n"), |
2596 |
WEECHAT_ERROR, "window merge"); |
WEECHAT_ERROR, "window merge"); |
2614 |
gui_switch_to_next_window (gui_current_window); |
gui_switch_to_next_window (gui_current_window); |
2615 |
else |
else |
2616 |
{ |
{ |
2617 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
2618 |
gui_printf (NULL, |
gui_printf (NULL, |
2619 |
_("%s unknown option for \"%s\" command\n"), |
_("%s unknown option for \"%s\" command\n"), |
2620 |
WEECHAT_ERROR, "window"); |
WEECHAT_ERROR, "window"); |