projects
/
mymail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e40b536
)
Added the "participant" search field.
author
Francois Fleuret
<francois@fleuret.org>
Thu, 31 Jan 2013 21:53:12 +0000
(22:53 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 31 Jan 2013 21:53:12 +0000
(22:53 +0100)
mymail.c
patch
|
blob
|
history
diff --git
a/mymail.c
b/mymail.c
index
dcb44bf
..
0593f62
100644
(file)
--- a/
mymail.c
+++ b/
mymail.c
@@
-56,7
+56,7
@@
enum {
ID_FROM,
ID_DEST,
ID_SUBJECT,
ID_FROM,
ID_DEST,
ID_SUBJECT,
- ID_
FROMDES
T,
+ ID_
PARTICIPAN
T,
MAX_ID
};
MAX_ID
};
@@
-65,7
+65,7
@@
static char *field_names[] = {
"from",
"dest",
"subj",
"from",
"dest",
"subj",
- "
fromdes
t"
+ "
par
t"
};
struct parsable_field {
};
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) {
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,
}
void search_in_db(int nb_search_patterns,