1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

Add "no_filter" tag, to prevent some lines to be filtered (like output of /filter command)

This commit is contained in:
Sebastien Helleu
2008-09-03 09:39:08 +02:00
parent 94c9b21450
commit 209df25bdb
3 changed files with 87 additions and 55 deletions
+24 -3
View File
@@ -42,6 +42,27 @@ struct t_gui_filter *last_gui_filter = NULL; /* last filter */
int gui_filters_enabled = 1; /* filters enabled? */
/*
* gui_filter_line_has_tag_no_filter: return 1 if line has tag "no_filter",
* which means that line should never
* been filtered (always displayed)
*/
int
gui_filter_line_has_tag_no_filter (struct t_gui_line *line)
{
int i;
for (i = 0; i < line->tags_count; i++)
{
if (strcmp (line->tags_array[i], GUI_FILTER_TAG_NO_FILTER) == 0)
return 1;
}
/* tag not found, line may be filtered */
return 0;
}
/*
* gui_filter_check_line: return 1 if a line should be displayed, or
* 0 if line is hidden (tag or regex found)
@@ -52,13 +73,13 @@ gui_filter_check_line (struct t_gui_buffer *buffer, struct t_gui_line *line)
{
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
(void) buffer;
/* line is always displayed if filters are disabled */
if (!gui_filters_enabled)
return 1;
if (gui_filter_line_has_tag_no_filter (line))
return 1;
for (ptr_filter = gui_filters; ptr_filter;
ptr_filter = ptr_filter->next_filter)
{
+2
View File
@@ -22,6 +22,8 @@
#include <regex.h>
#define GUI_FILTER_TAG_NO_FILTER "no_filter"
/* filter structures */
struct t_gui_line;