[evolution-patches] 72020, adjust-score never implemented
- From: Not Zed <notzed ximian com>
- To: asdf <evolution-patches lists ximian com>
- Subject: [evolution-patches] 72020, adjust-score never implemented
- Date: Tue, 01 Feb 2005 10:05:40 +0800
implemented, plus tiny cleanup (camefoldersummary changes make camel_folder_set_user*, etc redundant, should really remove them).
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2419
diff -u -p -r1.2419 ChangeLog
--- camel/ChangeLog 1 Feb 2005 00:47:43 -0000 1.2419
+++ camel/ChangeLog 1 Feb 2005 02:08:38 -0000
@@ -1,5 +1,12 @@
2005-02-01 Not Zed <NotZed Ximian com>
+ ** See bug #72020.
+
+ * camel-filter-driver.c (do_score): don't use
+ camel_folder_set_message_user_tag anymore, use the messageinfo
+ interface.
+ (do_adjust_score): implement missing function.
+
* camel-store.c (camel_store_folder_uri_equal): check the path
isn't NULL before dereferencing it. Could happen with badly
formed uris (since we're comparing folders, it MUST contain a path
Index: camel/camel-filter-driver.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-filter-driver.c,v
retrieving revision 1.90
diff -u -p -r1.90 camel-filter-driver.c
--- camel/camel-filter-driver.c 2 Dec 2004 08:03:29 -0000 1.90
+++ camel/camel-filter-driver.c 1 Feb 2005 02:08:39 -0000
@@ -141,6 +141,7 @@ static ESExpResult *do_move (struct _ESE
static ESExpResult *do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
static ESExpResult *do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
static ESExpResult *do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
+static ESExpResult *do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
static ESExpResult *set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
static ESExpResult *unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
static ESExpResult *do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *);
@@ -163,6 +164,7 @@ static struct {
{ "stop", (ESExpFunc *) do_stop, 0 },
{ "set-colour", (ESExpFunc *) do_colour, 0 },
{ "set-score", (ESExpFunc *) do_score, 0 },
+ { "adjust-score", (ESExpFunc *) do_adjust_score, 0 },
{ "set-system-flag", (ESExpFunc *) set_flag, 0 },
{ "unset-system-flag", (ESExpFunc *) unset_flag, 0 },
{ "pipe-message", (ESExpFunc *) pipe_message, 0 },
@@ -592,11 +594,29 @@ do_score (struct _ESExp *f, int argc, st
char *value;
value = g_strdup_printf ("%d", argv[0]->value.number);
- if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
- camel_folder_set_message_user_tag (p->source, p->uid, "score", value);
- else
- camel_message_info_set_user_tag(p->info, "score", value);
+ camel_message_info_set_user_tag(p->info, "score", value);
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set score to %d", argv[0]->value.number);
+ g_free (value);
+ }
+
+ return NULL;
+}
+
+static ESExpResult *
+do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
+{
+ struct _CamelFilterDriverPrivate *p = _PRIVATE(driver);
+
+ d(fprintf (stderr, "adjusting score tag\n"));
+ if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
+ char *value;
+ int old;
+
+ value = (char *)camel_message_info_user_tag(p->info, "score");
+ old = value?atoi(value):0;
+ value = g_strdup_printf ("%d", old+argv[0]->value.number);
+ camel_message_info_set_user_tag(p->info, "score", value);
+ camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Adjust score (%d) to %s", argv[0]->value.number, value);
g_free (value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]