[PATCH] lib: add support for thread:<message-id> queries
David Bremner
david at tethera.net
Tue Oct 17 19:00:06 PDT 2017
Jani Nikula <jani at nikula.org> writes:
> + if (strchr (thread.c_str (), '@'))
> + notmuch_database_find_message (notmuch, thread.c_str (), &message);
> +
> + if (message) {
> + thread_id = notmuch_message_get_thread_id (message);
> + notmuch_message_destroy (message);
> + } else {
> + thread_id = thread;
> + }
> +
> + return Xapian::Query (term_prefix + thread_id);
> +}
The other field processors throw Xapian::QueryParserErrors in case bad
things happen (e.g. failure to read from the database). This seems to be
better than nothing as it allows transmitting some detail to the
user. See e.g. "regex error reporting" in test/T650-regexp-query.sh. And
of course, speaking of tests, this should have one.
d
More information about the notmuch
mailing list