diff options
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r-- | camel/camel-folder-search.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index 0376dd9fef..f887986e3b 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -55,6 +55,7 @@ static ESExpResult *search_match_all(struct _ESExp *f, int argc, struct _ESExpTe static ESExpResult *search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search); static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s); static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s); +static ESExpResult *search_system_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s); 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); @@ -77,6 +78,7 @@ camel_folder_search_class_init (CamelFolderSearchClass *klass) klass->header_contains = search_header_contains; klass->user_tag = search_user_tag; klass->user_flag = search_user_flag; + klass->system_flag = search_system_flag; klass->get_sent_date = search_get_sent_date; klass->get_received_date = search_get_received_date; klass->get_current_date = search_get_current_date; @@ -170,9 +172,10 @@ struct { { "header-contains", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_contains), 1 }, { "user-tag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_tag), 1 }, { "user-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 }, + { "system-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, system_flag), 1 }, { "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 } + { "get-current-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_current_date), 1 }, }; void @@ -728,7 +731,8 @@ search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam return r; } -static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search) +static ESExpResult * +search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search) { ESExpResult *r; int i; @@ -756,6 +760,29 @@ static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpRe return r; } +static ESExpResult * +search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search) +{ + ESExpResult *r; + + r(printf ("executing system-flag\n")); + + if (search->current) { + gboolean truth = FALSE; + + if (argc == 1) + truth = camel_system_flag_get (search->current->flags, argv[0]->value.string); + + r = e_sexp_result_new (ESEXP_RES_BOOL); + r->value.bool = truth; + } else { + r = e_sexp_result_new (ESEXP_RES_ARRAY_PTR); + r->value.ptrarray = g_ptr_array_new (); + } + + return r; +} + static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search) { ESExpResult *r; |