summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-08-30 00:25:56 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-08-30 00:25:56 +0200
commit0839b359f9ad6fd88ef94e6ca4eac54c53156c68 (patch)
tree4580ffa94b96c331e9fb6c90a92281ef19eddc9f /src/gui
parenteb57354984dd1394f8b50911cee58180bbff2e88 (diff)
downloadweechat-0839b359f9ad6fd88ef94e6ca4eac54c53156c68.zip
Add new hooks (info and infolist), IRC plugin now return infos and infolists
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-completion.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index 87250f10d..4add497de 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -524,6 +524,48 @@ gui_completion_list_add_command_hooks (struct t_gui_completion *completion)
}
/*
+ * gui_completion_list_add_info_hooks: add info hooks to completion list
+ */
+
+void
+gui_completion_list_add_info_hooks (struct t_gui_completion *completion)
+{
+ struct t_hook *ptr_hook;
+
+ for (ptr_hook = weechat_hooks[HOOK_TYPE_INFO]; ptr_hook;
+ ptr_hook = ptr_hook->next_hook)
+ {
+ if (!ptr_hook->deleted
+ && (HOOK_INFO(ptr_hook, info_name))
+ && (HOOK_INFO(ptr_hook, info_name)[0]))
+ gui_completion_list_add (completion,
+ HOOK_INFO(ptr_hook, info_name),
+ 0, WEECHAT_LIST_POS_SORT);
+ }
+}
+
+/*
+ * gui_completion_list_add_infolist_hooks: add infolist hooks to completion list
+ */
+
+void
+gui_completion_list_add_infolist_hooks (struct t_gui_completion *completion)
+{
+ struct t_hook *ptr_hook;
+
+ for (ptr_hook = weechat_hooks[HOOK_TYPE_INFOLIST]; ptr_hook;
+ ptr_hook = ptr_hook->next_hook)
+ {
+ if (!ptr_hook->deleted
+ && (HOOK_INFOLIST(ptr_hook, infolist_name))
+ && (HOOK_INFOLIST(ptr_hook, infolist_name)[0]))
+ gui_completion_list_add (completion,
+ HOOK_INFOLIST(ptr_hook, infolist_name),
+ 0, WEECHAT_LIST_POS_SORT);
+ }
+}
+
+/*
* gui_completion_list_add_self_nick: add self nick on server to completion list
*/
@@ -952,6 +994,12 @@ gui_completion_build_list_template (struct t_gui_completion *completion,
case 'h': /* command hooks */
gui_completion_list_add_command_hooks (completion);
break;
+ case 'i': /* infos hooked */
+ gui_completion_list_add_info_hooks (completion);
+ break;
+ case 'I': /* infolists hooked */
+ gui_completion_list_add_infolist_hooks (completion);
+ break;
case 'm': /* self nickname */
gui_completion_list_add_self_nick (completion);
break;