mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
Many changes in IRC plugin, added IRC specific completions
This commit is contained in:
@@ -1908,7 +1908,7 @@ command_init ()
|
||||
" scroll 15 min down: /buffer scroll +15m\n"
|
||||
" scroll 20 msgs up: /buffer scroll -20\n"
|
||||
" jump to #weechat: /buffer #weechat"),
|
||||
"move|close|list|notify|scroll|set|%S|%C %S|%C",
|
||||
"move|close|list|notify|scroll|set|%b|%c %b|%c",
|
||||
command_buffer, NULL);
|
||||
hook_command (NULL, "builtin",
|
||||
N_("launch WeeChat builtin command (do not look at commands "
|
||||
@@ -1975,12 +1975,12 @@ command_init ()
|
||||
"all plugins, then autoload plugins)\n"
|
||||
" unload: unload one or all plugins\n\n"
|
||||
"Without argument, /plugin command lists loaded plugins."),
|
||||
"list|listfull|load|autoload|reload|unload %P",
|
||||
"list|listfull|load|autoload|reload|unload %p",
|
||||
command_plugin, NULL);
|
||||
hook_command (NULL, "quit",
|
||||
N_("quit WeeChat"),
|
||||
"", "",
|
||||
NULL,
|
||||
"%q",
|
||||
command_quit, NULL);
|
||||
hook_command (NULL, "reload",
|
||||
N_("reload WeeChat and plugins configuration files from "
|
||||
|
||||
@@ -74,7 +74,6 @@ struct t_config_option *config_look_prefix_align_max;
|
||||
struct t_config_option *config_look_prefix_suffix;
|
||||
struct t_config_option *config_look_nick_completor;
|
||||
struct t_config_option *config_look_nick_completion_ignore;
|
||||
struct t_config_option *config_look_nick_completion_smart;
|
||||
struct t_config_option *config_look_nick_complete_first;
|
||||
struct t_config_option *config_look_infobar;
|
||||
struct t_config_option *config_look_infobar_time_format;
|
||||
@@ -529,10 +528,6 @@ config_weechat_init ()
|
||||
ptr_section, "look_nick_completion_ignore", "string",
|
||||
N_("chars ignored for nick completion"),
|
||||
NULL, 0, 0, "[]-^", NULL);
|
||||
config_look_nick_completion_smart = config_file_new_option (
|
||||
ptr_section, "look_nick_completion_smart", "boolean",
|
||||
N_("smart completion for nicks (completes with last speakers first)"),
|
||||
NULL, 0, 0, "on", NULL);
|
||||
config_look_nick_complete_first = config_file_new_option (
|
||||
ptr_section, "look_nick_complete_first", "boolean",
|
||||
N_("complete only with first nick found"),
|
||||
|
||||
@@ -68,7 +68,6 @@ extern struct t_config_option *config_look_prefix_align_max;
|
||||
extern struct t_config_option *config_look_prefix_suffix;
|
||||
extern struct t_config_option *config_look_nick_completor;
|
||||
extern struct t_config_option *config_look_nick_completion_ignore;
|
||||
extern struct t_config_option *config_look_nick_completion_smart;
|
||||
extern struct t_config_option *config_look_nick_complete_first;
|
||||
extern struct t_config_option *config_look_infobar;
|
||||
extern struct t_config_option *config_look_infobar_time_format;
|
||||
|
||||
+6
-4
@@ -866,10 +866,13 @@ hook_completion (void *plugin, char *completion,
|
||||
*/
|
||||
|
||||
void
|
||||
hook_completion_exec (void *plugin, char *completion, void *list)
|
||||
hook_completion_exec (void *plugin, char *completion, void *buffer, void *list)
|
||||
{
|
||||
struct t_hook *ptr_hook, *next_hook;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) plugin;
|
||||
|
||||
hook_exec_recursion++;
|
||||
|
||||
ptr_hook = weechat_hooks;
|
||||
@@ -879,13 +882,12 @@ hook_completion_exec (void *plugin, char *completion, void *list)
|
||||
|
||||
if ((ptr_hook->type == HOOK_TYPE_COMPLETION)
|
||||
&& (!ptr_hook->running)
|
||||
&& (ptr_hook->plugin == plugin)
|
||||
&& (string_strcasecmp (HOOK_COMPLETION(ptr_hook, completion),
|
||||
completion) == 0))
|
||||
{
|
||||
ptr_hook->running = 1;
|
||||
(void) (HOOK_COMPLETION(ptr_hook, callback))
|
||||
(ptr_hook->callback_data, completion, list);
|
||||
(ptr_hook->callback_data, completion, buffer, list);
|
||||
if (ptr_hook->type == HOOK_TYPE_COMPLETION)
|
||||
ptr_hook->running = 0;
|
||||
}
|
||||
@@ -895,7 +897,7 @@ hook_completion_exec (void *plugin, char *completion, void *list)
|
||||
|
||||
if (hook_exec_recursion > 0)
|
||||
hook_exec_recursion--;
|
||||
|
||||
|
||||
if (hook_exec_recursion == 0)
|
||||
hook_remove_deleted ();
|
||||
}
|
||||
|
||||
+2
-2
@@ -123,7 +123,7 @@ struct t_hook_config
|
||||
/* (NULL = hook for all options) */
|
||||
};
|
||||
|
||||
typedef int (t_hook_callback_completion)(void *, char *, void *);
|
||||
typedef int (t_hook_callback_completion)(void *, char *, void *, void *);
|
||||
|
||||
struct t_hook_completion
|
||||
{
|
||||
@@ -161,7 +161,7 @@ extern struct t_hook *hook_config (void *, char *, char *,
|
||||
extern void hook_config_exec (char *, char *, char *);
|
||||
extern struct t_hook *hook_completion (void *, char *,
|
||||
t_hook_callback_completion *, void *);
|
||||
extern void hook_completion_exec (void *, char *, void *);
|
||||
extern void hook_completion_exec (void *, char *, void *, void *);
|
||||
|
||||
extern void unhook (struct t_hook *);
|
||||
extern void unhook_all_plugin (void *);
|
||||
|
||||
Reference in New Issue
Block a user