Changeset 25729b2 for functions.c


Ignore:
Timestamp:
Jan 8, 2007, 4:17:55 PM (17 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
723f464
Parents:
6beac73
git-author:
Nelson Elhage <nelhage@mit.edu> (01/08/07 15:55:09)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/08/07 16:17:55)
Message:
Adding basic smartnarrow support for jabber, and infrastructure to
make it extensible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r451becb r25729b2  
    28352835
    28362836  /* narrow personal and login messages to the sender or recip as appropriate */
    2837   if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
    2838     if (owl_message_is_type_zephyr(m)) {
     2837  if (owl_message_is_type_zephyr(m)) {
     2838    if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
    28392839      if (owl_message_is_direction_in(m)) {
    2840         zperson=short_zuser(owl_message_get_sender(m));
     2840        zperson=short_zuser(owl_message_get_sender(m));
    28412841      } else {
    2842         zperson=short_zuser(owl_message_get_recipient(m));
     2842        zperson=short_zuser(owl_message_get_recipient(m));
    28432843      }
    28442844      filtname=owl_function_zuserfilt(zperson);
     
    28462846      return(filtname);
    28472847    }
    2848     return(NULL);
    2849   }
    2850 
    2851   /* narrow class MESSAGE, instance foo, recip * messages to class, inst */
    2852   if (!strcasecmp(owl_message_get_class(m), "message") && !owl_message_is_personal(m)) {
    2853     filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
     2848
     2849    /* narrow class MESSAGE, instance foo, recip * messages to class, inst */
     2850    if (!strcasecmp(owl_message_get_class(m), "message") && !owl_message_is_personal(m)) {
     2851      filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
     2852      return(filtname);
     2853    }
     2854
     2855    /* otherwise narrow to the class */
     2856    if (type==0) {
     2857      filtname=owl_function_classinstfilt(owl_message_get_class(m), NULL);
     2858    } else if (type==1) {
     2859      filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
     2860    }
    28542861    return(filtname);
    28552862  }
    28562863
    2857   /* otherwise narrow to the class */
    2858   if (type==0) {
    2859     filtname=owl_function_classinstfilt(owl_message_get_class(m), NULL);
    2860   } else if (type==1) {
    2861     filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
    2862   }
    2863   return(filtname);
     2864  /* pass it off to perl */
     2865  char *argv[1];
     2866  if(type) {
     2867    argv[0] = "-i";
     2868  };
     2869  return owl_perlconfig_message_call_method(m, "smartfilter", type ? 1 : 0, argv);
    28642870}
    28652871
Note: See TracChangeset for help on using the changeset viewer.