diff options
-rw-r--r-- | po/fr.po | 10 | ||||
-rw-r--r-- | src/core/wee-hook.c | 278 | ||||
-rw-r--r-- | src/core/wee-hook.h | 3 | ||||
-rw-r--r-- | src/plugins/charset/charset.c | 12 | ||||
-rw-r--r-- | src/plugins/demo/demo.c | 34 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.c | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.c | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 4 | ||||
-rw-r--r-- | src/plugins/notify/notify.c | 20 | ||||
-rw-r--r-- | src/plugins/plugin-api.c | 22 | ||||
-rw-r--r-- | src/plugins/scripts/script.c | 16 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-command.c | 2 |
12 files changed, 345 insertions, 62 deletions
@@ -2718,15 +2718,19 @@ msgstr "" " listfull: afficher les serveurs avec de l'info détaillée pour chaque\n" " add: créer un nouveau serveur\n" "nom_serveur: nom du serveur, pour usage interne et affichage\n" -" nom: nom ou adresse IP du serveur avec port en option (defaut: 6667)\n" +" nom: nom ou adresse IP du serveur avec port en option (defaut: " +"6667)\n" " auto: se connecter automatiquement au serveur quand WeeChat démarre\n" -" noauto: ne pas se connecter au serveur quand WeeChat démarre (par défaut)\n" +" noauto: ne pas se connecter au serveur quand WeeChat démarre (par " +"défaut)\n" " ipv6: utiliser le protocole IPv6\n" " ssl: utiliser le protocole SSL\n" " copy: dupliquer un serveur\n" " rename: renommer un serveur\n" " del: supprimer un serveur\n" -" deloutq: supprimer la file d'attente des messages sortants pour tous les serveurs (tous les messages que WeeChat est actuellement en train d'envoyer)\n" +" deloutq: supprimer la file d'attente des messages sortants pour tous les " +"serveurs (tous les messages que WeeChat est actuellement en train " +"d'envoyer)\n" "\n" "Exemples :\n" " /server listfull\n" diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index e8f659342..0385686fd 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -34,6 +34,7 @@ #include "weechat.h" #include "wee-hook.h" +#include "wee-infolist.h" #include "wee-log.h" #include "wee-network.h" #include "wee-string.h" @@ -70,6 +71,28 @@ hook_init () } /* + * hook_search_type: search type string and return integer (-1 if not found) + */ + +int +hook_search_type (const char *type) +{ + int i; + + if (!type) + return -1; + + for (i = 0; i < HOOK_NUM_TYPES; i++) + { + if (strcmp (hook_type_string[i], type) == 0) + return i; + } + + /* type not found */ + return -1; +} + +/* * hook_find_pos: find position for new hook (keeping command list sorted) */ @@ -1462,6 +1485,228 @@ unhook_all () } /* + * hook_add_to_infolist_type: add hooks of a type in an infolist + * return 1 if ok, 0 if error + */ + +int +hook_add_to_infolist_type (struct t_infolist *infolist, + int type) +{ + struct t_hook *ptr_hook; + struct t_infolist_item *ptr_item; + char value[64]; + + for (ptr_hook = weechat_hooks[type]; ptr_hook; + ptr_hook = ptr_hook->next_hook) + { + ptr_item = infolist_new_item (infolist); + if (!ptr_item) + return 0; + + if (!infolist_new_var_pointer (ptr_item, "pointer", ptr_hook)) + return 0; + if (!infolist_new_var_pointer (ptr_item, "plugin", ptr_hook->plugin)) + return 0; + if (!infolist_new_var_string (ptr_item, "plugin_name", + (ptr_hook->plugin) ? + ptr_hook->plugin->name : NULL)) + return 0; + if (!infolist_new_var_string (ptr_item, "type", hook_type_string[ptr_hook->type])) + return 0; + if (!infolist_new_var_integer (ptr_item, "deleted", ptr_hook->deleted)) + return 0; + if (!infolist_new_var_integer (ptr_item, "running", ptr_hook->running)) + return 0; + switch (ptr_hook->type) + { + case HOOK_TYPE_COMMAND: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_COMMAND(ptr_hook, callback))) + return 0; + if (!infolist_new_var_string (ptr_item, "command", HOOK_COMMAND(ptr_hook, command))) + return 0; + if (!infolist_new_var_integer (ptr_item, "level", HOOK_COMMAND(ptr_hook, level))) + return 0; + if (!infolist_new_var_string (ptr_item, "description_en", + HOOK_COMMAND(ptr_hook, description))) + return 0; + if (!infolist_new_var_string (ptr_item, "description", + (HOOK_COMMAND(ptr_hook, description) + && HOOK_COMMAND(ptr_hook, description)[0]) ? + _(HOOK_COMMAND(ptr_hook, description)) : "")) + return 0; + if (!infolist_new_var_string (ptr_item, "args_en", + HOOK_COMMAND(ptr_hook, args))) + return 0; + if (!infolist_new_var_string (ptr_item, "args", + (HOOK_COMMAND(ptr_hook, args) + && HOOK_COMMAND(ptr_hook, args)[0]) ? + _(HOOK_COMMAND(ptr_hook, args)) : "")) + return 0; + if (!infolist_new_var_string (ptr_item, "args_description_en", + HOOK_COMMAND(ptr_hook, args_description))) + return 0; + if (!infolist_new_var_string (ptr_item, "args_description", + (HOOK_COMMAND(ptr_hook, args_description) + && HOOK_COMMAND(ptr_hook, args_description)[0]) ? + _(HOOK_COMMAND(ptr_hook, args_description)) : "")) + return 0; + if (!infolist_new_var_string (ptr_item, "completion", HOOK_COMMAND(ptr_hook, completion))) + return 0; + } + break; + case HOOK_TYPE_TIMER: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_TIMER(ptr_hook, callback))) + return 0; + snprintf (value, sizeof (value), "%ld", HOOK_TIMER(ptr_hook, interval)); + if (!infolist_new_var_string (ptr_item, "interval", value)) + return 0; + if (!infolist_new_var_integer (ptr_item, "remaining_calls", HOOK_TIMER(ptr_hook, remaining_calls))) + return 0; + if (!infolist_new_var_buffer (ptr_item, "last_exec", + &(HOOK_TIMER(ptr_hook, last_exec)), + sizeof (HOOK_TIMER(ptr_hook, last_exec)))) + return 0; + if (!infolist_new_var_buffer (ptr_item, "next_exec", + &(HOOK_TIMER(ptr_hook, next_exec)), + sizeof (HOOK_TIMER(ptr_hook, next_exec)))) + return 0; + } + break; + case HOOK_TYPE_FD: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_FD(ptr_hook, callback))) + return 0; + if (!infolist_new_var_integer (ptr_item, "fd", HOOK_FD(ptr_hook, fd))) + return 0; + if (!infolist_new_var_integer (ptr_item, "flags", HOOK_FD(ptr_hook, flags))) + return 0; + } + break; + case HOOK_TYPE_CONNECT: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_CONNECT(ptr_hook, callback))) + return 0; + if (!infolist_new_var_string (ptr_item, "address", HOOK_CONNECT(ptr_hook, address))) + return 0; + if (!infolist_new_var_integer (ptr_item, "port", HOOK_CONNECT(ptr_hook, port))) + return 0; + if (!infolist_new_var_integer (ptr_item, "sock", HOOK_CONNECT(ptr_hook, sock))) + return 0; + if (!infolist_new_var_integer (ptr_item, "ipv6", HOOK_CONNECT(ptr_hook, ipv6))) + return 0; +#ifdef HAVE_GNUTLS + if (!infolist_new_var_pointer (ptr_item, "gnutls_sess", HOOK_CONNECT(ptr_hook, gnutls_sess))) + return 0; +#endif + if (!infolist_new_var_string (ptr_item, "local_hostname", HOOK_CONNECT(ptr_hook, local_hostname))) + return 0; + if (!infolist_new_var_integer (ptr_item, "child_read", HOOK_CONNECT(ptr_hook, child_read))) + return 0; + if (!infolist_new_var_integer (ptr_item, "child_write", HOOK_CONNECT(ptr_hook, child_write))) + return 0; + if (!infolist_new_var_integer (ptr_item, "child_pid", HOOK_CONNECT(ptr_hook, child_pid))) + return 0; + if (!infolist_new_var_pointer (ptr_item, "hook_fd", HOOK_CONNECT(ptr_hook, hook_fd))) + return 0; + } + break; + case HOOK_TYPE_PRINT: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_PRINT(ptr_hook, callback))) + return 0; + if (!infolist_new_var_pointer (ptr_item, "buffer", HOOK_PRINT(ptr_hook, buffer))) + return 0; + if (!infolist_new_var_integer (ptr_item, "tags_count", HOOK_PRINT(ptr_hook, tags_count))) + return 0; + if (!infolist_new_var_pointer (ptr_item, "tags_array", HOOK_PRINT(ptr_hook, tags_array))) + return 0; + if (!infolist_new_var_string (ptr_item, "message", HOOK_PRINT(ptr_hook, message))) + return 0; + if (!infolist_new_var_integer (ptr_item, "strip_colors", HOOK_PRINT(ptr_hook, strip_colors))) + return 0; + } + break; + case HOOK_TYPE_SIGNAL: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_SIGNAL(ptr_hook, callback))) + return 0; + if (!infolist_new_var_string (ptr_item, "signal", HOOK_SIGNAL(ptr_hook, signal))) + return 0; + } + break; + case HOOK_TYPE_CONFIG: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_CONFIG(ptr_hook, callback))) + return 0; + if (!infolist_new_var_string (ptr_item, "option", HOOK_CONFIG(ptr_hook, option))) + return 0; + } + break; + case HOOK_TYPE_COMPLETION: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_COMPLETION(ptr_hook, callback))) + return 0; + if (!infolist_new_var_string (ptr_item, "completion_item", HOOK_COMPLETION(ptr_hook, completion_item))) + return 0; + } + break; + case HOOK_TYPE_MODIFIER: + if (!ptr_hook->deleted) + { + if (!infolist_new_var_pointer (ptr_item, "callback", HOOK_MODIFIER(ptr_hook, callback))) + return 0; + if (!infolist_new_var_string (ptr_item, "modifier", HOOK_MODIFIER(ptr_hook, modifier))) + return 0; + } + break; + case HOOK_NUM_TYPES: + /* this constant is used to count types only, + it is never used as type */ + break; + } + } + + return 1; +} + +/* + * hook_add_to_infolist: add hooks in an infolist + * if type == NULL or is not found, all types are returned + * return 1 if ok, 0 if error + */ + +int +hook_add_to_infolist (struct t_infolist *infolist, + const char *type) +{ + int i, type_int; + + if (!infolist) + return 0; + + type_int = (type) ? hook_search_type (type) : -1; + + for (i = 0; i < HOOK_NUM_TYPES; i++) + { + if ((type_int < 0) || (type_int == i)) + hook_add_to_infolist_type (infolist, i); + } + + return 1; +} + +/* * hook_print_log: print hooks in log (usually for crash dump) */ @@ -1497,10 +1742,10 @@ hook_print_log () log_printf (" callback . . . . . . : 0x%x", HOOK_COMMAND(ptr_hook, callback)); log_printf (" command. . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, command)); log_printf (" level. . . . . . . . : %d", HOOK_COMMAND(ptr_hook, level)); - log_printf (" command_desc . . . . : '%s'", HOOK_COMMAND(ptr_hook, description)); - log_printf (" command_args . . . . : '%s'", HOOK_COMMAND(ptr_hook, args)); - log_printf (" command_args_desc. . : '%s'", HOOK_COMMAND(ptr_hook, args_description)); - log_printf (" command_completion . : '%s'", HOOK_COMMAND(ptr_hook, completion)); + log_printf (" description. . . . . : '%s'", HOOK_COMMAND(ptr_hook, description)); + log_printf (" args . . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, args)); + log_printf (" args_description . . : '%s'", HOOK_COMMAND(ptr_hook, args_description)); + log_printf (" completion . . . . . : '%s'", HOOK_COMMAND(ptr_hook, completion)); } break; case HOOK_TYPE_TIMER: @@ -1509,6 +1754,7 @@ hook_print_log () log_printf (" timer data:"); log_printf (" callback . . . . . . : 0x%x", HOOK_TIMER(ptr_hook, callback)); log_printf (" interval . . . . . . : %ld", HOOK_TIMER(ptr_hook, interval)); + log_printf (" remaining_calls. . . : %d", HOOK_TIMER(ptr_hook, remaining_calls)); local_time = localtime (&HOOK_TIMER(ptr_hook, last_exec).tv_sec); strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); @@ -1530,17 +1776,26 @@ hook_print_log () { log_printf (" fd data:"); log_printf (" callback . . . . . . : 0x%x", HOOK_FD(ptr_hook, callback)); - log_printf (" fd . . . . . . . . . : %ld", HOOK_FD(ptr_hook, fd)); - log_printf (" flags. . . . . . . . : %ld", HOOK_FD(ptr_hook, flags)); + log_printf (" fd . . . . . . . . . : %d", HOOK_FD(ptr_hook, fd)); + log_printf (" flags. . . . . . . . : %d", HOOK_FD(ptr_hook, flags)); } break; case HOOK_TYPE_CONNECT: if (!ptr_hook->deleted) { - log_printf (" fd data:"); - log_printf (" callback . . . . . . : 0x%x", HOOK_FD(ptr_hook, callback)); - log_printf (" fd . . . . . . . . . : %ld", HOOK_FD(ptr_hook, fd)); - log_printf (" flags. . . . . . . . : %ld", HOOK_FD(ptr_hook, flags)); + log_printf (" connect data:"); + log_printf (" callback . . . . . . : 0x%x", HOOK_CONNECT(ptr_hook, callback)); + log_printf (" address. . . . . . . : '%s'", HOOK_CONNECT(ptr_hook, address)); + log_printf (" port . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, port)); + log_printf (" sock . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, sock)); + log_printf (" ipv6 . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, ipv6)); +#ifdef HAVE_GNUTLS + log_printf (" gnutls_sess. . . . . : 0x%x", HOOK_CONNECT(ptr_hook, gnutls_sess)); +#endif + log_printf (" local_hostname . . . : '%s'", HOOK_CONNECT(ptr_hook, local_hostname)); + log_printf (" child_read . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read)); + log_printf (" child_write. . . . . : %d", HOOK_CONNECT(ptr_hook, child_write)); + log_printf (" hook_fd. . . . . . . : 0x%x", HOOK_CONNECT(ptr_hook, hook_fd)); } break; case HOOK_TYPE_PRINT: @@ -1549,7 +1804,10 @@ hook_print_log () log_printf (" print data:"); log_printf (" callback . . . . . . : 0x%x", HOOK_PRINT(ptr_hook, callback)); log_printf (" buffer . . . . . . . : 0x%x", HOOK_PRINT(ptr_hook, buffer)); + log_printf (" tags_count . . . . . : %d", HOOK_PRINT(ptr_hook, tags_count)); + log_printf (" tags_array . . . . . : 0x%x", HOOK_PRINT(ptr_hook, tags_array)); log_printf (" message. . . . . . . : '%s'", HOOK_PRINT(ptr_hook, message)); + log_printf (" strip_colors . . . . : %d", HOOK_PRINT(ptr_hook, strip_colors)); } break; case HOOK_TYPE_SIGNAL: diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index 074ad97d5..74dab9747 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -27,6 +27,7 @@ struct t_gui_buffer; struct t_gui_completion; struct t_weelist; +struct t_infolist; /* hook types */ @@ -273,6 +274,8 @@ extern char *hook_modifier_exec (struct t_weechat_plugin *plugin, extern void unhook (struct t_hook *hook); extern void unhook_all_plugin (struct t_weechat_plugin *plugin); extern void unhook_all (); +extern int hook_add_to_infolist (struct t_infolist *infolist, + const char *type); extern void hook_print_log (); #endif /* wee-hook.h */ diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c index 0f4cc5134..e49ead786 100644 --- a/src/plugins/charset/charset.c +++ b/src/plugins/charset/charset.c @@ -545,12 +545,12 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) /* /charset command */ weechat_hook_command ("charset", - _("change charset for current buffer"), - _("[[decode | encode] charset] | [reset]"), - _(" decode: change decoding charset\n" - " encode: change encoding charset\n" - "charset: new charset for current buffer\n" - " reset: reset charsets for current buffer"), + N_("change charset for current buffer"), + N_("[[decode | encode] charset] | [reset]"), + N_(" decode: change decoding charset\n" + " encode: change encoding charset\n" + "charset: new charset for current buffer\n" + " reset: reset charsets for current buffer"), "decode|encode|reset", &charset_command_cb, NULL); diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c index c4660bf9c..7f61244ed 100644 --- a/src/plugins/demo/demo.c +++ b/src/plugins/demo/demo.c @@ -404,41 +404,41 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) demo_debug = weechat_config_boolean (weechat_config_get ("weechat.plugin.debug")); weechat_hook_command ("demo_printf", - _("print some messages on current ubffer"), - _("[text]"), - _("text: write this text"), + N_("print some messages on current ubffer"), + N_("[text]"), + N_("text: write this text"), "", &demo_printf_command_cb, NULL); weechat_hook_command ("demo_buffer", - _("open a new buffer"), - _("category name"), + N_("open a new buffer"), + N_("category name"), "", "", &demo_buffer_command_cb, NULL); weechat_hook_command ("demo_buffer_set", - _("set a buffer property"), - _("property value"), + N_("set a buffer property"), + N_("property value"), "", "", &demo_buffer_set_command_cb, NULL); weechat_hook_command ("demo_infolist", - _("get and display an infolist"), - _("infolist"), - _("infolist: infolist to display (values: buffer, " - "buffer_lines)"), + N_("get and display an infolist"), + N_("infolist"), + N_("infolist: infolist to display (values: buffer, " + "buffer_lines)"), "buffer|buffer_lines", &demo_infolist_command_cb, NULL); weechat_hook_command ("demo_info", - _("get and display an info"), - _("info"), - _("info: info to display (values: version, " - "weechat_dir, weechat_libdir, weechat_sharedir, " - "charset_terminal, charset_internal, inactivity, " - "input, input_mask, input_pos)"), + N_("get and display an info"), + N_("info"), + N_("info: info to display (values: version, " + "weechat_dir, weechat_libdir, weechat_sharedir, " + "charset_terminal, charset_internal, inactivity, " + "input, input_mask, input_pos)"), "version|weechat_dir|weechat_libdir|" "weechat_sharedir|charset_terminal|charset_internal|" "inactivity|input|input_mask|input_pos", diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 2634f0e6a..5b06cc56f 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -2870,7 +2870,7 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc, if (mask) { snprintf (mask, length, "irc.server.%s.*", server_found->name); - infolist = weechat_infolist_get ("options", NULL, mask); + infolist = weechat_infolist_get ("option", NULL, mask); free (mask); while (weechat_infolist_next (infolist)) { diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index afe4300d5..24d05f9af 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -316,7 +316,7 @@ irc_config_server_delete_cb (void *data, struct t_config_option *option) { snprintf (mask, length, "irc.server.%s.*", ptr_server->name); - infolist = weechat_infolist_get ("options", NULL, mask); + infolist = weechat_infolist_get ("option", NULL, mask); i = 0; while (weechat_infolist_next (infolist)) { @@ -346,7 +346,7 @@ irc_config_reload_servers_from_config () char *full_name, *option_name, *server_name, *pos_option; int i, index_option; - infolist = weechat_infolist_get ("options", NULL, "irc.server.*"); + infolist = weechat_infolist_get ("option", NULL, "irc.server.*"); while (weechat_infolist_next (infolist)) { full_name = weechat_infolist_string (infolist, "full_name"); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 32895fc6f..e15df5393 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -885,7 +885,7 @@ irc_server_duplicate (struct t_irc_server *server, const char *new_server_name) if (!mask) return 0; snprintf (mask, length, "irc.server.%s.*", server->name); - infolist = weechat_infolist_get ("options", NULL, mask); + infolist = weechat_infolist_get ("option", NULL, mask); free (mask); while (weechat_infolist_next (infolist)) { @@ -944,7 +944,7 @@ irc_server_rename (struct t_irc_server *server, const char *new_server_name) if (!mask) return 0; snprintf (mask, length, "irc.server.%s.*", server->name); - infolist = weechat_infolist_get ("options", NULL, mask); + infolist = weechat_infolist_get ("option", NULL, mask); free (mask); while (weechat_infolist_next (infolist)) { diff --git a/src/plugins/notify/notify.c b/src/plugins/notify/notify.c index b0c5eef06..4f7116794 100644 --- a/src/plugins/notify/notify.c +++ b/src/plugins/notify/notify.c @@ -494,16 +494,16 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) /* /notify command */ weechat_hook_command ("notify", - _("change notify level for current buffer"), - _("reset | none | highlight | message | all"), - _(" reset: reset notify level to default value\n" - " none: buffer will never be in hotlist\n" - "highlight: buffer will be in hotlist for " - "highlights only\n" - " message: buffer will be in hotlist for " - "highlights and user messages only\n" - " all: buffer will be in hotlist for " - "any text printed"), + N_("change notify level for current buffer"), + N_("reset | none | highlight | message | all"), + N_(" reset: reset notify level to default value\n" + " none: buffer will never be in hotlist\n" + "highlight: buffer will be in hotlist for " + "highlights only\n" + " message: buffer will be in hotlist for " + "highlights and user messages only\n" + " all: buffer will be in hotlist for " + "any text printed"), "reset|none|highlight|message|all", ¬ify_command_cb, NULL); diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 20e667bfe..87cedb9e0 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -34,6 +34,7 @@ #include "../core/weechat.h" #include "../core/wee-config.h" +#include "../core/wee-hook.h" #include "../core/wee-infolist.h" #include "../core/wee-input.h" #include "../core/wee-string.h" @@ -293,6 +294,10 @@ plugin_api_info_get (struct t_weechat_plugin *plugin, const char *info) { return WEECHAT_SHAREDIR; } + else if (string_strcasecmp (info, "weechat_localedir") == 0) + { + return LOCALEDIR; + } else if (string_strcasecmp (info, "charset_terminal") == 0) { return weechat_local_charset; @@ -469,7 +474,7 @@ plugin_api_infolist_get (const char *name, void *pointer, const char *arguments) } } } - else if (string_strcasecmp (name, "options") == 0) + else if (string_strcasecmp (name, "option") == 0) { ptr_infolist = infolist_new (); if (ptr_infolist) @@ -482,8 +487,21 @@ plugin_api_infolist_get (const char *name, void *pointer, const char *arguments) return ptr_infolist; } } + else if (string_strcasecmp (name, "hook") == 0) + { + ptr_infolist = infolist_new (); + if (ptr_infolist) + { + if (!hook_add_to_infolist (ptr_infolist, arguments)) + { + infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; + } + } - /* list not found */ + /* infolist not found */ return NULL; } diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index cd4522061..d24136d19 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -132,14 +132,14 @@ script_init (struct t_weechat_plugin *weechat_plugin, completion, weechat_plugin->name); } weechat_hook_command (weechat_plugin->name, - _("list/load/unload scripts"), - _("[list [name]] | [listfull [name]] " - "[load filename] | [autoload] | " - "[reload] | [unload [name]]"), - _("filename: script (file) to load\n" - "name: a script name\n\n" - "Without argument, this command " - "lists all loaded scripts."), + N_("list/load/unload scripts"), + N_("[list [name]] | [listfull [name]] " + "[load filename] | [autoload] | " + "[reload] | [unload [name]]"), + N_("filename: script (file) to load\n" + "name: a script name\n\n" + "Without argument, this command " + "lists all loaded scripts."), (string) ? string : completion, callback_command, NULL); if (string) diff --git a/src/plugins/xfer/xfer-command.c b/src/plugins/xfer/xfer-command.c index f7a211699..23f630a22 100644 --- a/src/plugins/xfer/xfer-command.c +++ b/src/plugins/xfer/xfer-command.c @@ -198,6 +198,6 @@ xfer_command_init () weechat_hook_command ("xfer", N_("xfer control"), "", - _("Open buffer with xfer list"), + N_("Open buffer with xfer list"), "list|listfull", &xfer_command_xfer, NULL); } |