From f364f9c86b041f3541f314443d53bc9c5cb77b7c Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Thu, 31 Jan 2013 22:53:12 +0100 Subject: [PATCH] Added the "participant" search field. --- mymail.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mymail.c b/mymail.c index dcb44bf..0593f62 100644 --- a/mymail.c +++ b/mymail.c @@ -56,7 +56,7 @@ enum { ID_FROM, ID_DEST, ID_SUBJECT, - ID_FROMDEST, + ID_PARTICIPANT, MAX_ID }; @@ -65,7 +65,7 @@ static char *field_names[] = { "from", "dest", "subj", - "fromdest" + "part" }; struct parsable_field { @@ -143,7 +143,11 @@ int ignore_entry(const char *name) { int mbox_line_match_search(int search_id, regex_t *search_regexp, int mbox_id, char *mbox_value) { - return search_id == mbox_id && regexec(search_regexp, mbox_value, 0, 0, 0) == 0; + return + (search_id == mbox_id || + (search_id == ID_PARTICIPANT && (mbox_id == ID_FROM || mbox_id == ID_DEST))) + && + regexec(search_regexp, mbox_value, 0, 0, 0) == 0; } void search_in_db(int nb_search_patterns, -- 2.20.1