summaryrefslogtreecommitdiff
path: root/message.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-23 06:00:10 -0700
committerCarl Worth <cworth@cworth.org>2009-10-23 06:00:10 -0700
commit6ccdffcd87b8af0c1c683588612169f5dc776644 (patch)
treecbd9ec67b2e21dce5757f3c1b91af67318d00ee9 /message.cc
parent1b5d8984c678add2ab5d1353b94a8229421269df (diff)
add_message: Fix to not add multiple documents with the same message ID
Here's the second big fix to message-ID handling, (the first was to generate message IDs when an email contained none). Now, with no document missing a message ID, and no two documents having the same message ID, we have a nice consistent database where the message ID can be used as a unique key.
Diffstat (limited to 'message.cc')
-rw-r--r--message.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/message.cc b/message.cc
index 281da4f..ce600af 100644
--- a/message.cc
+++ b/message.cc
@@ -41,6 +41,13 @@ struct _notmuch_thread_ids {
char *next;
};
+/* "128 bits of thread-id ought to be enough for anybody" */
+#define NOTMUCH_THREAD_ID_BITS 128
+#define NOTMUCH_THREAD_ID_DIGITS (NOTMUCH_THREAD_ID_BITS / 4)
+typedef struct _thread_id {
+ char str[NOTMUCH_THREAD_ID_DIGITS + 1];
+} thread_id_t;
+
#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0]))
/* These prefix values are specifically chosen to be compatible