2007-01-25 [colin] 2.7.1cvs55

* src/matcher.c
	* src/matcher.h
	* src/matcher_parser_parse.y
	* src/prefs_matcher.c
		Add matching on the spam flag
This commit is contained in:
Colin Leroy 2007-01-25 07:47:09 +00:00
parent d2ade1b37f
commit 1461ab7b42
7 changed files with 61 additions and 12 deletions

View file

@ -1,3 +1,11 @@
2007-01-25 [colin] 2.7.1cvs55
* src/matcher.c
* src/matcher.h
* src/matcher_parser_parse.y
* src/prefs_matcher.c
Add matching on the spam flag
2007-01-24 [colin] 2.7.1cvs54
* src/folder.c

View file

@ -2312,3 +2312,4 @@
( cvs diff -u -r 1.15.2.11 -r 1.15.2.12 src/addrcache.c; cvs diff -u -r 1.9.2.6 -r 1.9.2.7 src/addrcache.h; cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/addritem.c; cvs diff -u -r 1.12.2.7 -r 1.12.2.8 src/addritem.h; cvs diff -u -r 1.65.2.54 -r 1.65.2.55 src/codeconv.c; cvs diff -u -r 1.15.2.18 -r 1.15.2.19 src/codeconv.h; cvs diff -u -r 1.18.2.23 -r 1.18.2.24 src/jpilot.c; cvs diff -u -r 1.10.2.4 -r 1.10.2.5 src/jpilot.h; cvs diff -u -r 1.2.2.7 -r 1.2.2.8 src/ldapctrl.c; cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/ldapctrl.h; cvs diff -u -r 1.4.2.9 -r 1.4.2.10 src/ldapquery.h; cvs diff -u -r 1.12.2.11 -r 1.12.2.12 src/ldif.c; cvs diff -u -r 1.5.2.4 -r 1.5.2.5 src/ldif.h; cvs diff -u -r 1.43.2.60 -r 1.43.2.61 src/toolbar.c; cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/etpan/etpan-thread-manager.c; cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/etpan/etpan-thread-manager.h; cvs diff -u -r 1.5.2.50 -r 1.5.2.51 src/gtk/gtkutils.c; cvs diff -u -r 1.4.2.30 -r 1.4.2.31 src/gtk/gtkutils.h; ) > 2.7.1cvs52.patchset
( cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/plugins/bogofilter/bogofilter_gtk.c; ) > 2.7.1cvs53.patchset
( cvs diff -u -r 1.213.2.133 -r 1.213.2.134 src/folder.c; cvs diff -u -r 1.150.2.90 -r 1.150.2.91 src/procmsg.c; cvs diff -u -r 1.60.2.40 -r 1.60.2.41 src/procmsg.h; cvs diff -u -r 1.395.2.281 -r 1.395.2.282 src/summaryview.c; cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/common/xml.c; cvs diff -u -r 1.1.4.8 -r 1.1.4.9 src/common/xml.h; cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/plugins/bogofilter/bogofilter.c; cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/plugins/bogofilter/bogofilter.h; cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/plugins/bogofilter/bogofilter_gtk.c; cvs diff -u -r 1.18.2.47 -r 1.18.2.48 src/plugins/spamassassin/spamassassin.c; cvs diff -u -r 1.4.2.13 -r 1.4.2.14 src/plugins/spamassassin/spamassassin.h; cvs diff -u -r 1.23.2.36 -r 1.23.2.37 src/plugins/spamassassin/spamassassin_gtk.c; ) > 2.7.1cvs54.patchset
( cvs diff -u -r 1.75.2.34 -r 1.75.2.35 src/matcher.c; cvs diff -u -r 1.39.2.9 -r 1.39.2.10 src/matcher.h; cvs diff -u -r 1.25.2.20 -r 1.25.2.21 src/matcher_parser_parse.y; cvs diff -u -r 1.43.2.51 -r 1.43.2.52 src/prefs_matcher.c; ) > 2.7.1cvs55.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=7
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=54
EXTRA_VERSION=55
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -78,6 +78,8 @@ static const MatchParser matchparser_tab[] = {
{MATCHCRITERIA_NOT_COLORLABEL, "~colorlabel"},
{MATCHCRITERIA_IGNORE_THREAD, "ignore_thread"},
{MATCHCRITERIA_NOT_IGNORE_THREAD, "~ignore_thread"},
{MATCHCRITERIA_SPAM, "spam"},
{MATCHCRITERIA_NOT_SPAM, "~spam"},
/* msginfo headers */
{MATCHCRITERIA_SUBJECT, "subject"},
@ -573,6 +575,10 @@ gboolean matcherprop_match(MatcherProp *prop,
return MSG_IS_LOCKED(info->flags);
case MATCHCRITERIA_NOT_LOCKED:
return !MSG_IS_LOCKED(info->flags);
case MATCHCRITERIA_SPAM:
return MSG_IS_SPAM(info->flags);
case MATCHCRITERIA_NOT_SPAM:
return !MSG_IS_SPAM(info->flags);
case MATCHCRITERIA_COLORLABEL:
return MSG_GET_COLORLABEL_VALUE(info->flags) == prop->value;
case MATCHCRITERIA_NOT_COLORLABEL:
@ -1155,6 +1161,8 @@ gboolean matcherlist_match(MatcherList *matchers, MsgInfo *info)
case MATCHCRITERIA_NOT_FORWARDED:
case MATCHCRITERIA_LOCKED:
case MATCHCRITERIA_NOT_LOCKED:
case MATCHCRITERIA_SPAM:
case MATCHCRITERIA_NOT_SPAM:
case MATCHCRITERIA_COLORLABEL:
case MATCHCRITERIA_NOT_COLORLABEL:
case MATCHCRITERIA_IGNORE_THREAD:
@ -1327,6 +1335,8 @@ gchar *matcherprop_to_string(MatcherProp *matcher)
case MATCHCRITERIA_NOT_FORWARDED:
case MATCHCRITERIA_LOCKED:
case MATCHCRITERIA_NOT_LOCKED:
case MATCHCRITERIA_SPAM:
case MATCHCRITERIA_NOT_SPAM:
case MATCHCRITERIA_PARTIAL:
case MATCHCRITERIA_NOT_PARTIAL:
case MATCHCRITERIA_IGNORE_THREAD:

View file

@ -79,6 +79,7 @@ enum {
MC_(REPLIED), MC_(NOT_REPLIED),
MC_(FORWARDED), MC_(NOT_FORWARDED),
MC_(LOCKED), MC_(NOT_LOCKED),
MC_(SPAM),MC_(NOT_SPAM),
MC_(PARTIAL), MC_(NOT_PARTIAL),
MC_(COLORLABEL), MC_(NOT_COLORLABEL),
MC_(IGNORE_THREAD), MC_(NOT_IGNORE_THREAD),
@ -102,6 +103,7 @@ enum {
MC_(SIZE_SMALLER),
MC_(SIZE_EQUAL),
MC_(FOUND_IN_ADDRESSBOOK),MC_(NOT_FOUND_IN_ADDRESSBOOK),
/* match type */
MT_(MATCHCASE),
MT_(MATCH),

View file

@ -327,6 +327,7 @@ int matcher_parserwrap(void)
%token MATCHER_IGNORE_THREAD MATCHER_NOT_IGNORE_THREAD
%token MATCHER_CHANGE_SCORE MATCHER_SET_SCORE
%token MATCHER_STOP MATCHER_HIDE MATCHER_IGNORE
%token MATCHER_SPAM MATCHER_NOT_SPAM
%start file
@ -685,6 +686,20 @@ MATCHER_ALL
criteria = MATCHCRITERIA_NOT_LOCKED;
prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
}
| MATCHER_SPAM
{
gint criteria = 0;
criteria = MATCHCRITERIA_SPAM;
prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
}
| MATCHER_NOT_SPAM
{
gint criteria = 0;
criteria = MATCHCRITERIA_NOT_SPAM;
prop = matcherprop_new(criteria, NULL, 0, NULL, 0);
}
| MATCHER_PARTIAL
{
gint criteria = 0;

View file

@ -133,22 +133,23 @@ enum {
CRITERIA_REPLIED = 19,
CRITERIA_FORWARDED = 20,
CRITERIA_LOCKED = 21,
CRITERIA_COLORLABEL = 22,
CRITERIA_IGNORE_THREAD = 23,
CRITERIA_SPAM = 22,
CRITERIA_COLORLABEL = 23,
CRITERIA_IGNORE_THREAD = 24,
CRITERIA_SCORE_GREATER = 24,
CRITERIA_SCORE_LOWER = 25,
CRITERIA_SCORE_EQUAL = 26,
CRITERIA_SCORE_GREATER = 25,
CRITERIA_SCORE_LOWER = 26,
CRITERIA_SCORE_EQUAL = 27,
CRITERIA_TEST = 27,
CRITERIA_TEST = 28,
CRITERIA_SIZE_GREATER = 28,
CRITERIA_SIZE_SMALLER = 29,
CRITERIA_SIZE_EQUAL = 30,
CRITERIA_SIZE_GREATER = 29,
CRITERIA_SIZE_SMALLER = 30,
CRITERIA_SIZE_EQUAL = 31,
CRITERIA_PARTIAL = 31,
CRITERIA_PARTIAL = 32,
CRITERIA_FOUND_IN_ADDRESSBOOK = 32
CRITERIA_FOUND_IN_ADDRESSBOOK = 33,
};
/*!
@ -165,6 +166,7 @@ static const gchar *criteria_text [] = {
N_("Marked flag"), N_("Deleted flag"),
N_("Replied flag"), N_("Forwarded flag"),
N_("Locked flag"),
N_("Spam flag"),
N_("Color label"),
N_("Ignored thread"),
N_("Score greater than"), N_("Score lower than"),
@ -951,6 +953,9 @@ static gint prefs_matcher_get_criteria_from_matching(gint matching_id)
case MATCHCRITERIA_LOCKED:
case MATCHCRITERIA_NOT_LOCKED:
return CRITERIA_LOCKED;
case MATCHCRITERIA_NOT_SPAM:
case MATCHCRITERIA_SPAM:
return CRITERIA_SPAM;
case MATCHCRITERIA_PARTIAL:
case MATCHCRITERIA_NOT_PARTIAL:
return CRITERIA_PARTIAL;
@ -1050,6 +1055,8 @@ static gint prefs_matcher_get_matching_from_criteria(gint criteria_id)
return MATCHCRITERIA_FORWARDED;
case CRITERIA_LOCKED:
return MATCHCRITERIA_LOCKED;
case CRITERIA_SPAM:
return MATCHCRITERIA_SPAM;
case CRITERIA_PARTIAL:
return MATCHCRITERIA_PARTIAL;
case CRITERIA_COLORLABEL:
@ -1130,6 +1137,8 @@ static gint prefs_matcher_not_criteria(gint matcher_criteria)
return MATCHCRITERIA_NOT_FORWARDED;
case MATCHCRITERIA_LOCKED:
return MATCHCRITERIA_NOT_LOCKED;
case MATCHCRITERIA_SPAM:
return MATCHCRITERIA_NOT_SPAM;
case MATCHCRITERIA_PARTIAL:
return MATCHCRITERIA_NOT_PARTIAL;
case MATCHCRITERIA_COLORLABEL:
@ -1208,6 +1217,7 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
case CRITERIA_REPLIED:
case CRITERIA_FORWARDED:
case CRITERIA_LOCKED:
case CRITERIA_SPAM:
case CRITERIA_PARTIAL:
case CRITERIA_TEST:
case CRITERIA_COLORLABEL:
@ -1261,6 +1271,7 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
case CRITERIA_REPLIED:
case CRITERIA_FORWARDED:
case CRITERIA_LOCKED:
case CRITERIA_SPAM:
case CRITERIA_PARTIAL:
case CRITERIA_IGNORE_THREAD:
break;
@ -1610,6 +1621,7 @@ static void prefs_matcher_criteria_select(GtkList *list,
case CRITERIA_REPLIED:
case CRITERIA_FORWARDED:
case CRITERIA_LOCKED:
case CRITERIA_SPAM:
case CRITERIA_PARTIAL:
case CRITERIA_IGNORE_THREAD:
prefs_matcher_disable_widget(matcher.header_combo);
@ -2035,6 +2047,7 @@ static gboolean prefs_matcher_selected(GtkTreeSelection *selector,
case MATCHCRITERIA_NOT_REPLIED:
case MATCHCRITERIA_NOT_FORWARDED:
case MATCHCRITERIA_NOT_LOCKED:
case MATCHCRITERIA_NOT_SPAM:
case MATCHCRITERIA_NOT_PARTIAL:
case MATCHCRITERIA_NOT_COLORLABEL:
case MATCHCRITERIA_NOT_IGNORE_THREAD: