Changeset 89ab5c8 for functions.c


Ignore:
Timestamp:
May 23, 2010, 12:47:20 PM (11 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
7cc1092
Parents:
aa0a0b5 (diff), ecaec21 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge remote branch 'origin/narrow-cc'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r2cfc6d7 r89ab5c8  
    25012501}
    25022502
     2503static char *owl_function_smartfilter_cc(const owl_message *m) {
     2504  const char *ccs;
     2505  char *filtname;
     2506  char *text;
     2507  owl_filter *f;
     2508
     2509  ccs = owl_message_get_attribute_value(m, "zephyr_ccs");
     2510
     2511  filtname = owl_sprintf("conversation-%s", ccs);
     2512  owl_text_tr(filtname, ' ', '-');
     2513
     2514  if (owl_global_get_filter(&g, filtname)) {
     2515    return filtname;
     2516  }
     2517
     2518  text = owl_sprintf("type ^zephyr$ and filter personal and "
     2519                     "zephyr_ccs ^%s%s%s$",
     2520                     owl_getquoting(ccs), ccs, owl_getquoting(ccs));
     2521
     2522  f = owl_filter_new_fromstring(filtname, text);
     2523
     2524  owl_global_add_filter(&g, f);
     2525
     2526  owl_free(text);
     2527
     2528  return filtname;
     2529}
     2530
    25032531/* Create a filter based on the current message.  Returns the name of
    25042532 * a filter or null.  The caller must free this name.
     
    25542582  if (owl_message_is_type_zephyr(m)) {
    25552583    if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
     2584      if (owl_message_get_attribute_value(m, "zephyr_ccs") != NULL) {
     2585        return owl_function_smartfilter_cc(m);
     2586      }
     2587
    25562588      if (owl_message_is_direction_in(m)) {
    25572589        zperson=short_zuser(owl_message_get_sender(m));
Note: See TracChangeset for help on using the changeset viewer.