From: Francois Fleuret Date: Thu, 31 Jan 2013 21:53:12 +0000 (+0100) Subject: Added the "participant" search field. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=f364f9c86b041f3541f314443d53bc9c5cb77b7c;p=mymail.git Added the "participant" search field. --- 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,