aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/camel-filter-search.c42
2 files changed, 15 insertions, 36 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 714f8aa6a3..9780502f64 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-15 Not Zed <NotZed@Ximian.com>
+
+ * camel-filter-search.c (get_label): Removed.
+ (get_score): Removed. Labels & scores are stored in tags, we
+ already have a function to get tags.
+ (user_tag): Fail if we dont get valid arguments, it must be a
+ string type.
+ (system_flag): Same here.
+
2002-07-15 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-utils.c (header_msgid_generate): Try to get the FQDN
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index dd47bf386e..9475f3ad57 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -90,11 +90,9 @@ static ESExpResult *system_flag (struct _ESExp *f, int argc, struct _ESExpResult
static ESExpResult *get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
static ESExpResult *shell_exec (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
-static ESExpResult *get_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms);
/* builtin functions */
static struct {
@@ -120,11 +118,9 @@ static struct {
{ "get-sent-date", (ESExpFunc *) get_sent_date, 0 },
{ "get-received-date", (ESExpFunc *) get_received_date, 0 },
{ "get-current-date", (ESExpFunc *) get_current_date, 0 },
- { "get-score", (ESExpFunc *) get_score, 0 },
{ "get-source", (ESExpFunc *) get_source, 0 },
{ "get-size", (ESExpFunc *) get_size, 0 },
{ "shell-exec", (ESExpFunc *) shell_exec, 0 },
- { "get-label", (ESExpFunc *) get_label, 0 },
};
@@ -383,13 +379,12 @@ static ESExpResult *
system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
ESExpResult *r;
- gboolean truth = FALSE;
- if (argc == 1)
- truth = camel_system_flag_get (fms->info->flags, argv[0]->value.string);
+ if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
+ e_sexp_fatal_error(f, _("Invalid arguments to (system-flag)"));
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
- r->value.bool = truth;
+ r->value.bool = camel_system_flag_get (fms->info->flags, argv[0]->value.string);
return r;
}
@@ -399,6 +394,9 @@ user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageS
{
ESExpResult *r;
const char *tag;
+
+ if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
+ e_sexp_fatal_error(f, _("Invalid arguments to (user-tag)"));
tag = camel_tag_get (&fms->info->user_tags, argv[0]->value.string);
@@ -446,23 +444,6 @@ get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filter
}
static ESExpResult *
-get_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
- const char *tag;
-
- tag = camel_tag_get (&fms->info->user_tags, "score");
-
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- if (tag)
- r->value.number = atoi (tag);
- else
- r->value.number = 0;
-
- return r;
-}
-
-static ESExpResult *
get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{
CamelMimeMessage *message;
@@ -513,17 +494,6 @@ get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageS
return r;
}
-static ESExpResult *
-get_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
-{
- ESExpResult *r;
-
- r = e_sexp_result_new (f, ESEXP_RES_INT);
- r->value.number = atoi (camel_tag_get (&fms->info->user_tags, "label"));
-
- return r;
-}
-
static int
run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
{