aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-search.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-03-14 15:06:54 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-03-14 15:06:54 +0800
commit0e9c0268a8ae99b88d7b98539181c0e938e5cb53 (patch)
tree448e5a9d7b6797e4a396c942a8370c5db2a99540 /camel/camel-folder-search.c
parent83b4aa2b1d586cd9014394343b303d71e31ad3b8 (diff)
downloadgsoc2013-evolution-0e9c0268a8ae99b88d7b98539181c0e938e5cb53.tar.gz
gsoc2013-evolution-0e9c0268a8ae99b88d7b98539181c0e938e5cb53.tar.zst
gsoc2013-evolution-0e9c0268a8ae99b88d7b98539181c0e938e5cb53.zip
re-constify inbuf, to remove a warning.
2001-03-14 Not Zed <NotZed@Ximian.com> * camel-mime-filter-charset.c (filter, complete): re-constify inbuf, to remove a warning. * camel-mime-parser.c (folder_scan_step): When we're out of data, run the filter_complete. For some reason the logic that was there was never being run, always try it now, i think it was to work around a buggy filter, rather than fix it the right way. * camel-folder-summary.c (summary_build_content_info): If indexing html parts, use the html filter to convert it to some indexable format. (summary_build_content_info): Reset the filters before adding them back to the stream, if they get re-used in a given instance (likely). * Makefile.am (libcamelinclude_HEADERS): Added camel-mime-filter-html.[ch]. (INCLUDES): Added xml clags 2001-03-05 Not Zed <NotZed@Ximian.com> * camel-folder-search.c (camel_folder_search_class_init): Setup a new function, "uid" which matches uids. (search_uid): Implement the "match uid" command. svn path=/trunk/; revision=8705
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r--camel/camel-folder-search.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index aec5627875..7afb148b0d 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -64,6 +64,7 @@ static ESExpResult *search_system_flag(struct _ESExp *f, int argc, struct _ESExp
static ESExpResult *search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
@@ -91,6 +92,7 @@ camel_folder_search_class_init (CamelFolderSearchClass *klass)
klass->get_sent_date = search_get_sent_date;
klass->get_received_date = search_get_received_date;
klass->get_current_date = search_get_current_date;
+ klass->uid = search_uid;
}
static void
@@ -188,6 +190,7 @@ struct {
{ "get-sent-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_sent_date), 1 },
{ "get-received-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_received_date), 1 },
{ "get-current-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_current_date), 1 },
+ { "uid", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, uid), 1 },
};
void
@@ -851,3 +854,38 @@ search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv,
r->value.number = time (NULL);
return r;
}
+
+static ESExpResult *
+search_uid(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+{
+ ESExpResult *r;
+ int i;
+
+ r(printf("executing uid\n"));
+
+ /* are we inside a match-all? */
+ if (search->current) {
+ int truth = FALSE;
+ const char *uid = camel_message_info_uid(search->current);
+
+ /* performs an OR of all words */
+ for (i=0;i<argc && !truth;i++) {
+ if (argv[i]->type == ESEXP_RES_STRING
+ && !strcmp(uid, argv[i]->value.string)) {
+ truth = TRUE;
+ break;
+ }
+ }
+ r = e_sexp_result_new(f, ESEXP_RES_BOOL);
+ r->value.bool = truth;
+ } else {
+ r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
+ r->value.ptrarray = g_ptr_array_new();
+ for (i=0;i<argc;i++) {
+ if (argv[i]->type == ESEXP_RES_STRING)
+ g_ptr_array_add(r->value.ptrarray, argv[i]->value.string);
+ }
+ }
+
+ return r;
+}