mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 16:23:14 +02:00
Fix /reload command (now reloads config files with no reload callback)
This commit is contained in:
+10
-6
@@ -2007,8 +2007,15 @@ command_quit (void *data, struct t_gui_buffer *buffer,
|
||||
void
|
||||
command_reload_file (struct t_config_file *config_file)
|
||||
{
|
||||
if ((int) (config_file->callback_reload)
|
||||
(config_file->callback_reload_data, config_file) == 0)
|
||||
int rc;
|
||||
|
||||
if (config_file->callback_reload)
|
||||
rc = (int) (config_file->callback_reload)
|
||||
(config_file->callback_reload_data, config_file);
|
||||
else
|
||||
rc = config_file_reload (config_file);
|
||||
|
||||
if (rc == 0)
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("Options reloaded from %s"),
|
||||
@@ -2061,10 +2068,7 @@ command_reload (void *data, struct t_gui_buffer *buffer,
|
||||
for (ptr_config_file = config_files; ptr_config_file;
|
||||
ptr_config_file = ptr_config_file->next_config)
|
||||
{
|
||||
if (ptr_config_file->callback_reload)
|
||||
{
|
||||
command_reload_file (ptr_config_file);
|
||||
}
|
||||
command_reload_file (ptr_config_file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -572,23 +572,6 @@ logger_print_cb (void *data, struct t_gui_buffer *buffer, time_t date,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* logger_config_cb: callback for config hook
|
||||
*/
|
||||
|
||||
int
|
||||
logger_config_cb (void *data, const char *option, const char *value)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) option;
|
||||
(void) value;
|
||||
|
||||
logger_config_read ();
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_plugin_init: initialize logger plugin
|
||||
*/
|
||||
@@ -618,8 +601,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
weechat_hook_print (NULL, NULL, NULL, 1, &logger_print_cb, NULL);
|
||||
|
||||
weechat_hook_config ("plugins.var.logger.*", &logger_config_cb, NULL);
|
||||
|
||||
logger_info_init ();
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
Reference in New Issue
Block a user