1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

api: use pointer for infolist "hook" to return only one hook

This commit is contained in:
Sebastien Helleu
2013-07-28 12:40:08 +02:00
parent 1a7037d9cb
commit 0e4eb69d33
21 changed files with 461 additions and 388 deletions
+6 -2
View File
@@ -665,10 +665,14 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
}
else if (string_strcasecmp (infolist_name, "hook") == 0)
{
/* invalid hook pointer ? */
if (pointer && !hook_valid (pointer))
return NULL;
ptr_infolist = infolist_new ();
if (ptr_infolist)
{
if (!hook_add_to_infolist (ptr_infolist, arguments))
if (!hook_add_to_infolist (ptr_infolist, pointer, arguments))
{
infolist_free (ptr_infolist);
return NULL;
@@ -1154,7 +1158,7 @@ plugin_api_init ()
NULL,
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "hook", N_("list of hooks"),
NULL,
N_("hook pointer (optional)"),
N_("type,arguments (type is command/timer/.., arguments to "
"get only some hooks (can start or end with \"*\" as "
"wildcard), both are optional)"),