1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

core: apply filters after full reload of configuration files (with /reload) (bug #31182)

This commit is contained in:
Sebastien Helleu
2011-11-17 22:11:39 +01:00
parent 07727a97c9
commit 61e5a4bcdb
5 changed files with 19 additions and 45 deletions
+3 -1
View File
@@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.7-dev, 2011-11-15
v0.3.7-dev, 2011-11-17
Version 0.3.7 (under dev!)
--------------------------
* core: apply filters after full reload of configuration files (with /reload)
(bug #31182)
* core: allow list for option weechat.plugin.extension (makes weechat.conf
portable accross Un*x and Windows) (task #11479)
* core: fix compilation under OpenBSD 5.0 (lib utf8 not needed any more)
+9 -6
View File
@@ -1466,7 +1466,8 @@ COMMAND_CALLBACK(filter)
{
if (!ptr_filter->enabled)
{
gui_filter_enable (ptr_filter);
ptr_filter->enabled = 1;
gui_filter_all_buffers ();
gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER,
_("Filter \"%s\" enabled"),
ptr_filter->name);
@@ -1505,7 +1506,8 @@ COMMAND_CALLBACK(filter)
{
if (ptr_filter->enabled)
{
gui_filter_disable (ptr_filter);
ptr_filter->enabled = 0;
gui_filter_all_buffers ();
gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER,
_("Filter \"%s\" disabled"),
ptr_filter->name);
@@ -1542,10 +1544,8 @@ COMMAND_CALLBACK(filter)
ptr_filter = gui_filter_search_by_name (argv[2]);
if (ptr_filter)
{
if (ptr_filter->enabled)
gui_filter_disable (ptr_filter);
else
gui_filter_enable (ptr_filter);
ptr_filter->enabled ^= 1;
gui_filter_all_buffers ();
}
else
{
@@ -1598,6 +1598,7 @@ COMMAND_CALLBACK(filter)
if (ptr_filter)
{
gui_filter_all_buffers ();
gui_chat_printf (NULL, "");
gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER,
_("Filter \"%s\" added:"),
@@ -1658,6 +1659,7 @@ COMMAND_CALLBACK(filter)
if (gui_filters)
{
gui_filter_free_all ();
gui_filter_all_buffers ();
gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER,
_("All filters have been deleted"));
}
@@ -1673,6 +1675,7 @@ COMMAND_CALLBACK(filter)
if (ptr_filter)
{
gui_filter_free (ptr_filter);
gui_filter_all_buffers ();
gui_chat_printf_date_tags (NULL, 0, GUI_FILTER_TAG_NO_FILTER,
_("Filter \"%s\" deleted"),
argv[2]);
+6 -4
View File
@@ -661,6 +661,9 @@ config_weechat_init_after_read ()
if (!gui_keys[i])
gui_key_default_bindings (i);
}
/* apply filters on all buffers */
gui_filter_all_buffers ();
}
/*
@@ -704,8 +707,7 @@ config_weechat_reload_cb (void *data, struct t_config_file *config_file)
rc = config_file_reload (config_file);
if (rc == WEECHAT_CONFIG_READ_OK)
config_weechat_init_after_read ();
config_weechat_init_after_read ();
return rc;
}
@@ -2783,8 +2785,8 @@ config_weechat_read ()
int rc;
rc = config_file_read (weechat_config_file);
if (rc == WEECHAT_CONFIG_READ_OK)
config_weechat_init_after_read ();
config_weechat_init_after_read ();
if (rc != WEECHAT_CONFIG_READ_OK)
{
-32
View File
@@ -221,34 +221,6 @@ gui_filter_global_disable ()
}
}
/*
* gui_filter_enable: enable a filter
*/
void
gui_filter_enable (struct t_gui_filter *filter)
{
if (filter && !filter->enabled)
{
filter->enabled = 1;
gui_filter_all_buffers ();
}
}
/*
* gui_filter_disable: disable a filter
*/
void
gui_filter_disable (struct t_gui_filter *filter)
{
if (filter && filter->enabled)
{
filter->enabled = 0;
gui_filter_all_buffers ();
}
}
/*
* gui_filter_search_by_name: search a filter by name
*/
@@ -382,8 +354,6 @@ gui_filter_new (int enabled, const char *name, const char *buffer_name,
last_gui_filter = new_filter;
new_filter->next_filter = NULL;
gui_filter_all_buffers ();
hook_signal_send ("filter_added",
WEECHAT_HOOK_SIGNAL_POINTER, new_filter);
}
@@ -456,8 +426,6 @@ gui_filter_free (struct t_gui_filter *filter)
free (filter);
gui_filter_all_buffers ();
hook_signal_send ("filter_removed", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
+1 -2
View File
@@ -55,10 +55,9 @@ extern int gui_filters_enabled;
extern int gui_filter_check_line (struct t_gui_line *line,
const char *buffer_full_name);
extern void gui_filter_all_buffers ();
extern void gui_filter_global_enable ();
extern void gui_filter_global_disable ();
extern void gui_filter_enable (struct t_gui_filter *filter);
extern void gui_filter_disable (struct t_gui_filter *filter);
extern struct t_gui_filter *gui_filter_search_by_name (const char *name);
extern struct t_gui_filter *gui_filter_new (int enabled,
const char *name,