From 4c8b4d608002a44fba14e496e273f836e0849087 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 24 Oct 2008 18:17:10 +0200 Subject: Add "enabled" flag for each filter (now possible to disable only one or some filters) --- src/core/wee-config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core/wee-config.c') diff --git a/src/core/wee-config.c b/src/core/wee-config.c index b5bf36a6d..c884b15ab 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -706,7 +706,11 @@ config_weechat_filter_read (void *data, argv_eol = string_explode (value, ";", 1, 0, NULL); if (argv && argv_eol && (argc >= 3)) { - gui_filter_new (argv[0], argv[1], argv_eol[2]); + if (argc == 3) + gui_filter_new (1, argv[0], argv[1], argv_eol[2]); + else + gui_filter_new ((string_strcasecmp (argv[0], "on") == 0) ? 1 : 0, + argv[1], argv[2], argv_eol[3]); } if (argv) string_free_exploded (argv); @@ -737,7 +741,8 @@ config_weechat_filter_write (void *data, struct t_config_file *config_file, { config_file_write_line (config_file, "filter", - "%s;%s;%s", + "%s;%s;%s;%s", + (ptr_filter->enabled) ? "on" : "off", ptr_filter->buffer, ptr_filter->tags, ptr_filter->regex); -- cgit v1.2.3