diff options
| author | David Bremner <david@tethera.net> | 2021-09-10 07:34:16 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-09-10 07:34:16 -0300 |
| commit | 7059f0ed5dbdb871d47b6bf34af7671931c233d1 (patch) | |
| tree | 85733b25b3171edb3c965e55c607b00d55e5de32 /lib | |
| parent | 674775134fa752f566174f17b618070b564190b3 (diff) | |
| parent | b6cfc8a61c20aec1e54185829718f87c7f7dea79 (diff) | |
Merge branch 'debian/bullseye' into debian/buster-backports
Update to current Debian stable
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/add-message.cc | 9 | ||||
| -rw-r--r-- | lib/config.cc | 11 | ||||
| -rw-r--r-- | lib/notmuch-private.h | 14 |
3 files changed, 21 insertions, 13 deletions
diff --git a/lib/add-message.cc b/lib/add-message.cc index 485debad..b47aa501 100644 --- a/lib/add-message.cc +++ b/lib/add-message.cc @@ -407,14 +407,17 @@ static notmuch_status_t _notmuch_database_link_message (notmuch_database_t *notmuch, notmuch_message_t *message, notmuch_message_file_t *message_file, - bool is_ghost) + bool is_ghost, + bool is_new) { void *local = talloc_new (NULL); notmuch_status_t status; const char *thread_id = NULL; /* Check if the message already had a thread ID */ - if (notmuch->features & NOTMUCH_FEATURE_GHOSTS) { + if (! is_new) { + thread_id = notmuch_message_get_thread_id (message); + } else if (notmuch->features & NOTMUCH_FEATURE_GHOSTS) { if (is_ghost) thread_id = notmuch_message_get_thread_id (message); } else { @@ -539,7 +542,7 @@ notmuch_database_index_file (notmuch_database_t *notmuch, } ret = _notmuch_database_link_message (notmuch, message, - message_file, is_ghost); + message_file, is_ghost, is_new); if (ret) goto DONE; diff --git a/lib/config.cc b/lib/config.cc index efab01e4..0b760dbc 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -133,8 +133,15 @@ notmuch_database_get_config_list (notmuch_database_t *notmuch, *out = list; DONE: - if (status && list) - talloc_free (list); + if (status) { + if (list) { + talloc_free (list); + if (status != NOTMUCH_STATUS_XAPIAN_EXCEPTION) + _notmuch_config_list_destroy (list); + } + } else { + talloc_set_destructor (list, _notmuch_config_list_destroy); + } return status; } diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 57ec7f72..41aff342 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -31,6 +31,12 @@ #include "notmuch.h" +#include "xutil.h" +#include "error_util.h" +#include "string-util.h" +#include "crypto.h" +#include "repair.h" + NOTMUCH_BEGIN_DECLS #include <stdlib.h> @@ -47,14 +53,6 @@ NOTMUCH_BEGIN_DECLS #include <talloc.h> -#include "gmime-extra.h" - -#include "xutil.h" -#include "error_util.h" -#include "string-util.h" -#include "crypto.h" -#include "repair.h" - #ifdef DEBUG # define DEBUG_DATABASE_SANITY 1 # define DEBUG_THREADING 1 |
