Changeset 65fc0900 for filter.c


Ignore:
Timestamp:
Sep 17, 2002, 7:17:36 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1583c90
Parents:
3a2daac
Message:
You can now use %me% in filters
The built-in personal filter is updated to do so
File:
1 edited

Legend:

Unmodified
Added
Removed
  • filter.c

    r4b464a4 r65fc0900  
    1717  int i, error;
    1818  owl_filterelement *fe;
     19  char *regexstr;
    1920   
    2021  f->name=owl_strdup(name);
     
    2324  f->cachedmsgid=-1;
    2425  owl_list_create(&(f->fes));
    25 
     26 
    2627  /* first take arguments that have to come first */
    2728  /* set the color */
     
    3132    argv+=2;
    3233  }
    33 
     34 
    3435  /* then deal with the expression */
    3536  for (i=0; i<argc; i++) {
    3637    error=0;
    3738    fe=owl_malloc(sizeof(owl_filterelement));
    38 
     39   
    3940    /* all the 0 argument possibilities */
    4041    if (!strcmp(argv[i], "(")) {
     
    4849    } else if (!strcasecmp(argv[i], "not")) {
    4950      owl_filterelement_create_not(fe);
    50 
     51     
    5152    } else if (i==argc-1) {
    5253      error=1;
     
    6162          !strcasecmp(argv[i], "type") ||
    6263          !strcasecmp(argv[i], "direction")) {
    63         owl_filterelement_create_re(fe, argv[i], argv[i+1]);
     64        regexstr=owl_util_substitute(argv[i+1], "%me%", ZGetSender());
     65        owl_filterelement_create_re(fe, argv[i], regexstr);
     66        owl_free(regexstr);
    6467        i++;
    6568      } else {
Note: See TracChangeset for help on using the changeset viewer.