]> git.deb.at Git - pkg/abook.git/blob - contrib/whitelist/patch.orig.obsolete
Merge remote-tracking branch 'upstream/master' into upstream
[pkg/abook.git] / contrib / whitelist / patch.orig.obsolete
1 54a55,56
2 > static void             procmail_query(char *str);
3 > static void             procmail_print_email(int item);
4 498a501,503
5 >               if( !strcmp(argv[i], "--procmail-query") )
6 >                       procmail_query(argv[i + 1]);
7 >               else
8 561a567,583
9
10 > static void
11 > procmail_print_email(int item)
12 > {
13 >       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
14
15 >       split_emailstr(item, emails);
16 >       
17 >       if( options_get_int("mutt", "return_all_emails") ) {
18 >               int i;
19 >               for(i=0; i<MAX_EMAILS; i++)
20 >                       if( *emails[i] )
21 >                               printf("%s\n", emails[i]);
22 >       } else
23 >               printf("%s\n", emails[0]);
24 > }
25
26 571c593
27 <               printf("All items\n");
28 ---
29 >               /*printf("All items\n");*/
30 580a603,633
31 >                               j++;
32 >                       }
33 >                       free(tmp);
34 >               }
35 >               if( !j )
36 >                       printf("Not found\n");
37 >       }
38
39 >       quit_mutt_query();
40 >       exit(0);
41 > }
42
43 > static void
44 > procmail_query(char *str)
45 > {
46 >       int i, j;
47 >       char *tmp;
48 >       
49 >       init_mutt_query();
50
51 >       if( str == NULL || !strcasecmp(str, "all") ) {
52 >               /*printf("All items\n");*/
53 >               for(i = 0; i < items; i++)
54 >                       procmail_print_email(i);
55 >       } else {
56 >               for(i = 0, j = 0 ; i < items; i++) {
57 >                       tmp = strdup(database[i][NAME]);
58 >                       if( strstr( strupper(tmp), strupper(str) ) != NULL ) {
59 >                               if( !j )
60 >                                       putchar('\n');
61 >                               procmail_print_email(i);