summaryrefslogtreecommitdiffstats
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-11 15:30:04 -0300
committerDavid Bremner <david@tethera.net>2020-07-18 11:03:28 -0300
commitc76832a2037d375ab99dbeba3b37d1aca2103a36 (patch)
treeaaf56fcb8bad16076d3d7e97c1bc6514662070bf /notmuch-search.c
parent2d04ed263121d970cd24a8c26ac924425a7ae3d2 (diff)
cli/search: replace deprecated notmuch_message_get_flag
Our handling of errors is all or nothing here, but it's an improvement on the status quo, and it avoids rippling internal API changes.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index fd0b58c5..2805d960 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -90,9 +90,13 @@ get_thread_query (notmuch_thread_t *thread,
notmuch_messages_move_to_next (messages)) {
notmuch_message_t *message = notmuch_messages_get (messages);
const char *mid = notmuch_message_get_message_id (message);
+ notmuch_bool_t is_set;
+ char **buf;
+
+ if (notmuch_message_get_flag_st (message, NOTMUCH_MESSAGE_FLAG_MATCH, &is_set))
+ return -1;
/* Determine which query buffer to extend */
- char **buf = notmuch_message_get_flag (
- message, NOTMUCH_MESSAGE_FLAG_MATCH) ? matched_out : unmatched_out;
+ buf = is_set ? matched_out : unmatched_out;
/* Add this message's id: query. Since "id" is an exclusive
* prefix, it is implicitly 'or'd together, so we only need to
* join queries with a space. */