Changeset 81655f8


Ignore:
Timestamp:
May 12, 2008, 8:01:58 PM (12 years ago)
Author:
Alejandro R. Sedeño <asedeno@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:
9f4e3f8
Parents:
6b3878b
Message:
* filterelement.c - quote regexp filter elements with spaces in them.
* functions.c - deal with smart-narrowing when the user's screenname has spaces in it.
* owl.h - add a new struct member to the global to hold an escaped aim screenname.
* global.c - populate the aforementioned new struct member.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • filterelement.c

    raf1920fd r81655f8  
    138138static void owl_filterelement_print_re(owl_filterelement *fe, char *buf)
    139139{
     140  char *re, *q;
    140141  strcat(buf, fe->field);
    141142  strcat(buf, " ");
    142   strcat(buf, owl_regex_get_string(&(fe->re)));
     143
     144  re = owl_regex_get_string(&(fe->re));
     145  q = owl_getquoting(re);
     146  strcat(buf, q);
     147  strcat(buf, re);
     148  strcat(buf, q);
    143149}
    144150
  • functions.c

    rdb0ac7e r81655f8  
    27232723  sprintf(argbuff,
    27242724          "( type ^aim$ and ( ( sender ^%s$ and recipient ^%s$ ) or ( sender ^%s$ and recipient ^%s$ ) ) )",
    2725           escuser, owl_global_get_aim_screenname(&g), owl_global_get_aim_screenname(&g), escuser);
     2725          escuser, owl_global_get_aim_screenname_for_filters(&g),
     2726          owl_global_get_aim_screenname_for_filters(&g), escuser);
    27262727
    27272728  owl_filter_init_fromstring(f, filtname, argbuff);
  • global.c

    rdb0ac7e r81655f8  
    9898
    9999  g->aim_screenname=NULL;
     100  g->aim_screenname_for_filters=NULL;
    100101  g->aim_loggedin=0;
    101102  owl_timer_create_countdown(&(g->aim_noop_timer), 30);
     
    748749}
    749750
     751char *owl_global_get_aim_screenname_for_filters(owl_global *g)
     752{
     753  if (owl_global_is_aimloggedin(g)) {
     754    return (g->aim_screenname_for_filters);
     755  }
     756  return("");
     757}
     758
    750759void owl_global_set_aimloggedin(owl_global *g, char *screenname)
    751760{
     761  char *sn_escaped, *quote;
    752762  g->aim_loggedin=1;
    753763  if (g->aim_screenname) owl_free(g->aim_screenname);
     764  if (g->aim_screenname_for_filters) owl_free(g->aim_screenname_for_filters);
    754765  g->aim_screenname=owl_strdup(screenname);
     766  sn_escaped = owl_text_quote(screenname, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     767  quote = owl_getquoting(sn_escaped);
     768  g->aim_screenname_for_filters=sprintf("%s%s%s", quote, sn_escaped, quote);
     769  owl_free(sn_escaped);
    755770}
    756771
  • owl.h

    rdb0ac7e r81655f8  
    621621  int aim_doprocessing;     /* true if we should process AIM events (like pending login) */
    622622  char *aim_screenname;     /* currently logged in AIM screen name */
     623  char *aim_screenname_for_filters;     /* currently logged in AIM screen name */
    623624  owl_buddylist buddylist;  /* list of logged in AIM buddies */
    624625  owl_list messagequeue;    /* for queueing up aim and other messages */
Note: See TracChangeset for help on using the changeset viewer.