tracker r2449 - in trunk: . src/tracker-indexer/modules
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2449 - in trunk: . src/tracker-indexer/modules
- Date: Tue, 4 Nov 2008 16:11:52 +0000 (UTC)
Author: carlosg
Date: Tue Nov 4 16:11:52 2008
New Revision: 2449
URL: http://svn.gnome.org/viewvc/tracker?rev=2449&view=rev
Log:
2008-11-04 Carlos Garnacho <carlos imendio com>
* src/tracker-indexer/modules/evolution.c (get_mbox_message_id):
Return -1 if the header X-Evolution does not exist in the message.
(get_mbox_uri) (get_mbox_attachment_uri): Return NULL URIs if it
couldn't get the message ID.
Modified:
trunk/ChangeLog
trunk/src/tracker-indexer/modules/evolution.c
Modified: trunk/src/tracker-indexer/modules/evolution.c
==============================================================================
--- trunk/src/tracker-indexer/modules/evolution.c (original)
+++ trunk/src/tracker-indexer/modules/evolution.c Tue Nov 4 16:11:52 2008
@@ -614,7 +614,12 @@
gint id;
header = g_mime_message_get_header (message, "X-Evolution");
- pos = strchr (header, '-');
+
+ if (!header) {
+ return -1;
+ }
+
+ pos = strchr (header, '-');
number = g_strndup (header, pos - header);
id = strtoul (number, NULL, 16);
@@ -642,11 +647,20 @@
gchar **basename)
{
gchar *dir, *name;
+ gint message_id;
+
+ message_id = get_mbox_message_id (message);
+
+ if (message_id < 0) {
+ *dirname = NULL;
+ *basename = NULL;
+ return;
+ }
dir = tracker_string_replace (file->path, local_dir, NULL);
dir = tracker_string_remove (dir, ".sbd");
- name = g_strdup_printf ("%s;uid=%d", dir, get_mbox_message_id (message));
+ name = g_strdup_printf ("%s;uid=%d", dir, message_id);
*dirname = g_strdup ("email://local local");
*basename = name;
@@ -661,13 +675,22 @@
gchar **dirname,
gchar **basename)
{
+ gint message_id;
gchar *dir;
+ message_id = get_mbox_message_id (message);
+
+ if (message_id < 0) {
+ *dirname = NULL;
+ *basename = NULL;
+ return;
+ }
+
dir = tracker_string_replace (file->path, local_dir, NULL);
dir = tracker_string_remove (dir, ".sbd");
*dirname = g_strdup_printf ("email://local local/%s;uid=%d",
- dir, get_mbox_message_id (message));
+ dir, message_id);
*basename = g_strdup (g_mime_part_get_filename (part));
g_free (dir);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]