Changeset ecaec21


Ignore:
Timestamp:
May 7, 2010, 9:40:42 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
63d9de9
Parents:
4727d31
git-author:
Nelson Elhage <nelhage@mit.edu> (05/07/10 21:19:09)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/07/10 21:40:42)
Message:
Make smartnarrow work better on CC:'d personals
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    ra41c8d1 recaec21  
    25062506}
    25072507
     2508static char *owl_function_smartfilter_cc(const owl_message *m) {
     2509  const char *ccs;
     2510  char *filtname;
     2511  char *text;
     2512  owl_filter *f;
     2513
     2514  ccs = owl_message_get_attribute_value(m, "zephyr_ccs");
     2515
     2516  filtname = owl_sprintf("conversation-%s", ccs);
     2517  owl_text_tr(filtname, ' ', '-');
     2518
     2519  if (owl_global_get_filter(&g, filtname)) {
     2520    return filtname;
     2521  }
     2522
     2523  text = owl_sprintf("type ^zephyr$ and filter personal and "
     2524                     "zephyr_ccs ^%s%s%s$",
     2525                     owl_getquoting(ccs), ccs, owl_getquoting(ccs));
     2526
     2527  f = owl_filter_new_fromstring(filtname, text);
     2528
     2529  owl_global_add_filter(&g, f);
     2530
     2531  owl_free(text);
     2532
     2533  return filtname;
     2534}
     2535
    25082536/* Create a filter based on the current message.  Returns the name of
    25092537 * a filter or null.  The caller must free this name.
     
    25592587  if (owl_message_is_type_zephyr(m)) {
    25602588    if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
     2589      if (owl_message_get_attribute_value(m, "zephyr_ccs") != NULL) {
     2590        return owl_function_smartfilter_cc(m);
     2591      }
     2592
    25612593      if (owl_message_is_direction_in(m)) {
    25622594        zperson=short_zuser(owl_message_get_sender(m));
Note: See TracChangeset for help on using the changeset viewer.