From a53721c4b8b58f74f9c605f8238cdf5a45633f67 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Fri, 20 Apr 2007 06:13:56 +0000 Subject: [PATCH] 2007-04-20 [colin] 2.9.1cvs3 * src/matcher.c Implement proper references filtering condition. Patch based on a patch by Khanh-Dang --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/matcher.c | 27 +++++++++++++++++++++++---- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b37d78e7..aa918025d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-20 [colin] 2.9.1cvs3 + + * src/matcher.c + Implement proper references filtering condition. + Patch based on a patch by Khanh-Dang + 2007-04-19 [wwp] 2.9.1cvs2 * src/prefs_display_header.c diff --git a/PATCHSETS b/PATCHSETS index 8e5974459..e7424f8b8 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2530,3 +2530,4 @@ ( cvs diff -u -r 1.1.2.38 -r 1.1.2.39 manual/advanced.xml; cvs diff -u -r 1.1.2.15 -r 1.1.2.16 manual/glossary.xml; ) > 2.9.0cvs9.patchset ( cvs diff -u -r 1.42.2.30 -r 1.42.2.31 NEWS; cvs diff -u -r 1.8.2.34 -r 1.8.2.35 README; cvs diff -u -r 1.1.2.19 -r 1.1.2.20 RELEASE_NOTES; cvs diff -u -r 1.654.2.2585 -r 1.654.2.2586 configure.ac; ) > 2.9.1cvs1.patchset ( cvs diff -u -r 1.16.2.27 -r 1.16.2.28 src/prefs_display_header.c; cvs diff -u -r 1.3.12.27 -r 1.3.12.28 src/message_search.c; ) > 2.9.1cvs2.patchset +( cvs diff -u -r 1.75.2.39 -r 1.75.2.40 src/matcher.c; ) > 2.9.1cvs3.patchset diff --git a/configure.ac b/configure.ac index d70b6c930..20b329950 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=2 +EXTRA_VERSION=3 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/matcher.c b/src/matcher.c index e002a9994..f10b0159e 100644 --- a/src/matcher.c +++ b/src/matcher.c @@ -500,6 +500,27 @@ static gboolean matcherprop_string_match(MatcherProp *prop, const gchar *str, return ret; } +/*! + *\brief Find out if the string-ed list matches a condition + * + *\param prop Matcher structure + *\param list GSList of strings to check + * + *\return gboolean TRUE if str matches the condition in the + * matcher structure + */ +static gboolean matcherprop_list_match(MatcherProp *prop, const GSList *list, +const gchar *debug_context) +{ + const GSList *cur; + + for(cur = list; cur != NULL; cur = cur->next) { + if (matcherprop_string_match(prop, (gchar *)cur->data, debug_context)) + return TRUE; + } + return FALSE; +} + /* FIXME body search is a hack. */ static gboolean matcherprop_string_decode_match(MatcherProp *prop, const gchar *str, const gchar *debug_context) @@ -979,12 +1000,10 @@ gboolean matcherprop_match(MatcherProp *prop, return matcherprop_string_match(prop, info->inreplyto, _("InReplyTo: header")); case MATCHCRITERIA_NOT_INREPLYTO: return !matcherprop_string_match(prop, info->inreplyto, _("InReplyTo: header")); - /* FIXME: Using inreplyto, but matching the (newly implemented) - * list of references is better */ case MATCHCRITERIA_REFERENCES: - return matcherprop_string_match(prop, info->inreplyto, _("InReplyTo: header (references)")); + return matcherprop_list_match(prop, info->references, _("References: header")); case MATCHCRITERIA_NOT_REFERENCES: - return !matcherprop_string_match(prop, info->inreplyto, _("InReplyTo: header (references)")); + return !matcherprop_list_match(prop, info->references, _("References: header")); case MATCHCRITERIA_TEST: return matcherprop_match_test(prop, info); case MATCHCRITERIA_NOT_TEST: -- 2.25.1