#include <gmime/gmime.h>
-struct visible _notmuch_message {
+struct _notmuch_message {
notmuch_database_t *notmuch;
Xapian::docid doc_id;
int frozen;
/* GMime really doesn't want to see a NULL date, so protect its
* sensibilities. */
- if (date == NULL || *date == '\0')
+ if (date == NULL || *date == '\0') {
time_value = 0;
- else
+ } else {
time_value = g_mime_utils_header_decode_date (date, NULL);
+ /*
+ * Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=779923
+ */
+ if (time_value < 0)
+ time_value = 0;
+ }
message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,
Xapian::sortable_serialise (time_value));
query = notmuch_query_create (notmuch, query_string);
if (query == NULL)
return NOTMUCH_STATUS_OUT_OF_MEMORY;
- status = notmuch_query_count_messages_st (query, &count);
+ status = notmuch_query_count_messages (query, &count);
if (status) {
notmuch_query_destroy (query);
return status;
const char *key;
char *value;
- value = index(node->string, '=');
+ value = strchr(node->string, '=');
if (!value)
INTERNAL_ERROR ("malformed property term");