aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-filter-search.c8
-rw-r--r--camel/camel-folder-search.c3
-rw-r--r--camel/camel-folder-search.h3
4 files changed, 19 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 4d70eb4ab1..a21445fa11 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,12 @@
2001-02-23 Not Zed <NotZed@Ximian.com>
+ * camel-filter-search.c (check_header): Implement a pseudo-header
+ "x-camel-mlist" which just looks up in the message info for a
+ match.
+
+ * camel-folder-search.c (check_header): Add pseudo-header
+ "x-camel-mlist" which can be used to match on mailing list.
+
* providers/imap/camel-imap-folder.c (imap_sync): Add some
internal progress reporting.
(imap_rescan): Do some progress reporting.
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index b7590fe197..a680c26146 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -104,7 +104,13 @@ check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
int i;
if (argc > 1 && argv[0]->type == ESEXP_RES_STRING) {
- const char *header = camel_medium_get_header (CAMEL_MEDIUM (fms->message), argv[0]->value.string);
+ char *name = argv[0]->value.string;
+ const char *header;
+
+ if (strcasecmp(name, "x-camel-mlist") == 0)
+ header = camel_message_info_mlist(fms->info);
+ else
+ header = camel_medium_get_header (CAMEL_MEDIUM (fms->message), argv[0]->value.string);
if (header) {
for (i=1;i<argc && !matched;i++) {
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 546dbe66ed..aec5627875 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -544,6 +544,8 @@ check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolder
header = camel_message_info_to(search->current);
} else if (!strcasecmp(headername, "cc")) {
header = camel_message_info_cc(search->current);
+ } else if (!strcasecmp(headername, "x-camel-mlist")) {
+ header = camel_message_info_mlist(search->current);
} else {
e_sexp_resultv_free(f, argc, argv);
e_sexp_fatal_error(f, _("Performing query on unknown header: %s"), headername);
@@ -849,4 +851,3 @@ search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv,
r->value.number = time (NULL);
return r;
}
-
diff --git a/camel/camel-folder-search.h b/camel/camel-folder-search.h
index ff24950e53..e085ddf188 100644
--- a/camel/camel-folder-search.h
+++ b/camel/camel-folder-search.h
@@ -102,6 +102,9 @@ struct _CamelFolderSearchClass {
/* (get-current-date) Retrieve 'now' as a time_t */
ESExpResult * (*get_current_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+
+ /* (mlist-matches "mlist" ...) True if one of the mailing list matches */
+ ESExpResult * (*mlist_matches)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
};
guint camel_folder_search_get_type (void);