Changeset ce74deb for message.c


Ignore:
Timestamp:
Apr 22, 2007, 3:12:12 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
f178fb5
Parents:
f6c2b3d
git-author:
Nelson Elhage <nelhage@mit.edu> (04/22/07 15:11:07)
git-committer:
Nelson Elhage <nelhage@mit.edu> (04/22/07 15:12:12)
Message:
Improving the private/personal distinction by fixing owl_message_is_personal
* ``private'' means to/or from an individual, not a chat/class/etc.
* ``personal'' means ``matches the personal filter''
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r85d1795 rce74deb  
    550550int owl_message_is_personal(owl_message *m)
    551551{
    552   if (owl_message_is_type_zephyr(m)) {
    553     if (strcasecmp(owl_message_get_class(m), "message")) return(0);
    554     if (strcasecmp(owl_message_get_instance(m), "personal")) return(0);
    555     if (!strcasecmp(owl_message_get_recipient(m), owl_zephyr_get_sender()) ||
    556         !strcasecmp(owl_message_get_sender(m), owl_zephyr_get_sender())) {
    557       return(1);
    558     }
    559   }
    560   return(0);
     552  owl_filter * f = owl_global_get_filter(&g, "personal");
     553  if(!f) {
     554      owl_function_error("personal filter is not defined");
     555      return (0);
     556  }
     557  return owl_filter_message_match(f, m);
    561558}
    562559
     
    838835 
    839836  /* set the "isprivate" attribute if it's a private zephyr.
    840    ``private'' means recipient is */
     837   ``private'' means recipient is non-empty and doesn't start wit
     838   `@' */
    841839  if (*n->z_recipient && *n->z_recipient != '@') {
    842840    owl_message_set_isprivate(m);
     
    976974    owl_message_set_hostname(m, hostbuff);
    977975  }
     976
     977  /* set the "isprivate" attribute if it's a private zephyr. */
     978  if (owl_zwrite_is_personal(&z)) {
     979    owl_message_set_isprivate(m);
     980  }
     981
    978982  owl_zwrite_free(&z);
    979 
    980   if(owl_message_is_personal(m))
    981     owl_message_set_isprivate(m);
    982983}
    983984
Note: See TracChangeset for help on using the changeset viewer.