diff options
| author | David Bremner <bremner@debian.org> | 2012-01-27 18:04:44 -0400 |
|---|---|---|
| committer | David Bremner <bremner@debian.org> | 2012-01-27 18:04:44 -0400 |
| commit | bcd44490684965082e5921d0fc71064af3170987 (patch) | |
| tree | 12506f79f6792236b95ef0d6a19ab5113bb4587d /lib | |
| parent | bfb7feb1f51ae348503046823d72348621e34d08 (diff) | |
| parent | ffce9b7c25b9b44ec026b67d96e44cae09c99efe (diff) | |
Merge commit 'debian/0.11-1' into squeeze-backports
Conflicts:
debian/changelog
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Makefile.local | 2 | ||||
| -rw-r--r-- | lib/database.cc | 17 | ||||
| -rw-r--r-- | lib/message.cc | 14 |
3 files changed, 22 insertions, 11 deletions
diff --git a/lib/Makefile.local b/lib/Makefile.local index 57dca702..54c4dea4 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -30,7 +30,7 @@ LIBRARY_SUFFIX = so LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX) SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR) LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE) -LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) +LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined ifeq ($(LIBDIR_IN_LDCONFIG),1) ifeq ($(DESTDIR),) LIBRARY_INSTALL_POST_COMMAND=ldconfig diff --git a/lib/database.cc b/lib/database.cc index 98f101e6..8103bd96 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -28,6 +28,8 @@ #include <glib.h> /* g_free, GPtrArray, GHashTable */ #include <glib-object.h> /* g_type_init */ +#include <gmime/gmime.h> /* g_mime_init */ + using namespace std; #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) @@ -81,13 +83,17 @@ typedef struct { * STRING is the name of a file within that * directory for this mail message. * - * A mail document also has two values: + * A mail document also has four values: * * TIMESTAMP: The time_t value corresponding to the message's * Date header. * * MESSAGE_ID: The unique ID of the mail mess (see "id" above) * + * FROM: The value of the "From" header + * + * SUBJECT: The value of the "Subject" header + * * In addition, terms from the content of the message are added with * "from", "to", "attachment", and "subject" prefixes for use by the * user in searching. Similarly, terms from the path of the mail @@ -581,6 +587,7 @@ notmuch_database_open (const char *path, struct stat st; int err; unsigned int i, version; + static int initialized = 0; if (asprintf (¬much_path, "%s/%s", path, ".notmuch") == -1) { notmuch_path = NULL; @@ -604,6 +611,12 @@ notmuch_database_open (const char *path, /* Initialize the GLib type system and threads */ g_type_init (); + /* Initialize gmime */ + if (! initialized) { + g_mime_init (0); + initialized = 1; + } + notmuch = talloc (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; notmuch->path = talloc_strdup (notmuch, path); @@ -1447,7 +1460,7 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch, keys = g_hash_table_get_keys (parents); for (l = keys; l; l = l->next) { char *parent_message_id; - const char *parent_thread_id; + const char *parent_thread_id = NULL; parent_message_id = (char *) l->data; diff --git a/lib/message.cc b/lib/message.cc index ca7fbf21..00754254 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -49,16 +49,16 @@ struct visible _notmuch_message { struct maildir_flag_tag { char flag; const char *tag; - bool inverse; + notmuch_bool_t inverse; }; /* ASCII ordered table of Maildir flags and associated tags */ static struct maildir_flag_tag flag2tag[] = { - { 'D', "draft", false}, - { 'F', "flagged", false}, - { 'P', "passed", false}, - { 'R', "replied", false}, - { 'S', "unread", true } + { 'D', "draft", FALSE}, + { 'F', "flagged", FALSE}, + { 'P', "passed", FALSE}, + { 'R', "replied", FALSE}, + { 'S', "unread", TRUE } }; /* We end up having to call the destructor explicitly because we had @@ -1217,8 +1217,6 @@ _new_maildir_filename (void *ctx, if (info == NULL) { info = filename + strlen(filename); } else { - flags = info + 3; - /* Loop through existing flags in filename. */ for (flags = info + 3, last_flag = 0; *flags; |
