[PATCH] lib: add support for thread:<message-id> queries

Jani Nikula jani at nikula.org
Sat Oct 21 04:16:24 PDT 2017


On Tue, 17 Oct 2017, David Bremner <david at tethera.net> wrote:
> 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.

I'm not sure what you're suggesting. Do you mean I should open-code
notmuch_database_find_message() or notmuch_message_get_thread_id() to
get at the exceptions thrown within them?

BR,
Jani.


More information about the notmuch mailing list