diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-09-09 04:36:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-09-09 04:36:14 +0800 |
commit | f9d0db03faef147752790fe0d0e254b954776b61 (patch) | |
tree | 33114754b5ffd27211005757ad9206fbc10663c3 /filter/filter-driver.c | |
parent | e114c6fb58935bc406438bc69b7f53febf0c7e16 (diff) | |
download | gsoc2013-evolution-f9d0db03faef147752790fe0d0e254b954776b61.tar.gz gsoc2013-evolution-f9d0db03faef147752790fe0d0e254b954776b61.tar.zst gsoc2013-evolution-f9d0db03faef147752790fe0d0e254b954776b61.zip |
Added scoring xml stuffs
2000-09-08 Jeffrey Stedfast <fejj@helixcode.com>
* filtertypes.xml: Added scoring xml stuffs
* Makefile.am: added filter-score.[c,h]
* filter-score.[c,h]: New functions to handle the "score" filter
type.
* filter-element.c (filter_element_new_type_name): Added support
for "score" type.
* filter-driver.c (do_score): New ESExp callback for filter
actions to set the score on a message.
* filter-message-search.c (get_score): New ESExp callback for
getting the score tag as an integer value.
svn path=/trunk/; revision=5274
Diffstat (limited to 'filter/filter-driver.c')
-rw-r--r-- | filter/filter-driver.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/filter/filter-driver.c b/filter/filter-driver.c index e7c733b6a7..a233b580ad 100644 --- a/filter/filter-driver.c +++ b/filter/filter-driver.c @@ -79,6 +79,7 @@ static ESExpResult *mark_forward (struct _ESExp *f, int argc, struct _ESExpResul static ESExpResult *mark_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); static ESExpResult *do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); static ESExpResult *do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); +static ESExpResult *do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); /* these are our filter actions - each must have a callback */ static struct { @@ -92,6 +93,7 @@ static struct { { "copy-to", (ESExpFunc *) mark_copy, 0 }, { "stop", (ESExpFunc *) do_stop, 0 }, { "set-colour", (ESExpFunc *) do_colour, 0 }, + { "set-score", (ESExpFunc *) do_score, 0 } }; static GtkObjectClass *filter_driver_parent; @@ -303,7 +305,7 @@ do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver struct _FilterDriverPrivate *p = _PRIVATE (driver); if (!p->terminated) { - d(fprintf (stderr, "setting colour flag\n")); + d(fprintf (stderr, "setting colour tag\n")); if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) { camel_tag_set (&p->info->user_tags, "colour", argv[0]->value.string); } @@ -312,6 +314,25 @@ do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver return NULL; } +static ESExpResult * +do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) +{ + struct _FilterDriverPrivate *p = _PRIVATE (driver); + + if (!p->terminated) { + d(fprintf (stderr, "setting score tag\n")); + if (argc > 0 && argv[0]->type == ESEXP_RES_INT) { + char *value; + + value = g_strdup_printf ("%d", argv[0]->value.number); + camel_tag_set (&p->info->user_tags, "score", value); + g_free (value); + } + } + + return NULL; +} + static CamelFolder * open_folder (FilterDriver *driver, const char *folder_url) { |