Changeset 5789230


Ignore:
Timestamp:
Jun 5, 2003, 2:26:51 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
aac889a
Parents:
ae4cd12
Message:
'isloginout' and 'isprivate' are now message attributes
improved 'info' function lists seperate info for zephyr, aim and
   also prints all message attributes
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r65ad073 r5789230  
    8787        Added the 'aim_ingorelogin_timer' variable
    8888        'addbuddy zephyr <user>' and 'delbuddy zephyr <user>' now work.
     89        'isloginout' and 'isprivate' are now message attributes
     90        improved 'info' function lists seperate info for zephyr, aim and
     91           also prints all message attributes
    8992       
    90931.2.8
  • fmtext.c

    rf2f9314 r5789230  
    55static const char fileIdent[] = "$Id$";
    66
    7 void owl_fmtext_init_null(owl_fmtext *f) {
     7void owl_fmtext_init_null(owl_fmtext *f)
     8{
    89  f->textlen=0;
    910  f->textbuff=owl_strdup("");
     
    1516
    1617
    17 void _owl_fmtext_set_attr(owl_fmtext *f, int attr, int first, int last) {
     18void _owl_fmtext_set_attr(owl_fmtext *f, int attr, int first, int last)
     19{
    1820  int i;
    1921  for (i=first; i<=last; i++) {
     
    2224}
    2325
    24 void _owl_fmtext_add_attr(owl_fmtext *f, int attr, int first, int last) {
     26void _owl_fmtext_add_attr(owl_fmtext *f, int attr, int first, int last)
     27{
    2528  int i;
    2629  for (i=first; i<=last; i++) {
     
    2932}
    3033
    31 void _owl_fmtext_set_color(owl_fmtext *f, int color, int first, int last) {
     34void _owl_fmtext_set_color(owl_fmtext *f, int color, int first, int last)
     35{
    3236  int i;
    3337  for (i=first; i<=last; i++) {
     
    3741
    3842
    39 void owl_fmtext_append_attr(owl_fmtext *f, char *text, int attr, int color) {
     43void owl_fmtext_append_attr(owl_fmtext *f, char *text, int attr, int color)
     44{
    4045  int newlen;
    4146
     
    5257
    5358
    54 void owl_fmtext_append_normal(owl_fmtext *f, char *text) {
     59void owl_fmtext_append_normal(owl_fmtext *f, char *text)
     60{
    5561  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, OWL_COLOR_DEFAULT);
    5662}
    5763
    58 void owl_fmtext_append_normal_color(owl_fmtext *f, char *text, int color) {
     64void owl_fmtext_append_normal_color(owl_fmtext *f, char *text, int color)
     65{
    5966  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, color);
    6067}
    6168
    6269
    63 void owl_fmtext_append_bold(owl_fmtext *f, char *text) {
     70void owl_fmtext_append_bold(owl_fmtext *f, char *text)
     71{
    6472  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT);
    6573}
    6674
    6775
    68 void owl_fmtext_append_reverse(owl_fmtext *f, char *text) {
     76void owl_fmtext_append_reverse(owl_fmtext *f, char *text)
     77{
    6978  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE, OWL_COLOR_DEFAULT);
    7079}
    7180
    7281
    73 void owl_fmtext_append_reversebold(owl_fmtext *f, char *text) {
     82void owl_fmtext_append_reversebold(owl_fmtext *f, char *text)
     83{
    7484  owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE | OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT);
    7585}
    7686
    7787
    78 void owl_fmtext_addattr(owl_fmtext *f, int attr) {
     88void owl_fmtext_addattr(owl_fmtext *f, int attr)
     89{
    7990  /* add the attribute to all text */
    8091  int i, j;
     
    8697}
    8798
    88 void owl_fmtext_colorize(owl_fmtext *f, int color) {
     99void owl_fmtext_colorize(owl_fmtext *f, int color)
     100{
    89101  /* everywhere the color is OWL_COLOR_DEFAULT, change it to be 'color' */
    90102  int i, j;
     
    97109
    98110
    99 void owl_fmtext_append_ztext(owl_fmtext *f, char *text) {
     111void owl_fmtext_append_ztext(owl_fmtext *f, char *text)
     112{
    100113  int stacksize, curattrs, curcolor;
    101114  char *ptr, *txtptr, *buff, *tmpptr;
     
    216229      } else {
    217230        /* if we didn't understand it, we'll print it.  This is different from zwgc
    218            but zwgc seems to be smarter about some screw cases than I am */
     231         * but zwgc seems to be smarter about some screw cases than I am
     232         */
    219233        owl_fmtext_append_attr(f, "@", curattrs, curcolor);
    220234        txtptr++;
     
    282296}
    283297
    284 void owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in, int start, int stop) {
     298/* This is used internally to fmtext.  Use owl_fmtext_append_fmtext()
     299 * (no initial underscore) externally */
     300void _owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in, int start, int stop)
     301{
    285302  int newlen, i;
    286303
     
    299316}
    300317
    301 void owl_fmtext_append_spaces(owl_fmtext *f, int nspaces) {
     318void owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in)
     319{
     320  _owl_fmtext_append_fmtext(f, in, 0, in->textlen);
     321
     322}
     323
     324void owl_fmtext_append_spaces(owl_fmtext *f, int nspaces)
     325{
    302326  int i;
    303327  for (i=0; i<nspaces; i++) {
     
    310334 * If format_fn is specified, passes it the list element value
    311335 * and it will return a string which this needs to free. */
    312 void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(void*)) {
     336void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(void*))
     337{
    313338  int i, size;
    314339  void *elem;
     
    335360
    336361/* caller is responsible for freeing */
    337 char *owl_fmtext_print_plain(owl_fmtext *f) {
     362char *owl_fmtext_print_plain(owl_fmtext *f)
     363{
    338364  return owl_strdup(f->textbuff);
    339365}
    340366
    341367
    342 void owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w) {
     368void owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w)
     369{
    343370  char *tmpbuff;
    344371  int position, trans1, trans2, len, lastsame;
     
    395422
    396423
    397 int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out) {
     424int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out)
     425{
    398426  /* start with line aline (where the first line is 0) and print
    399427   *  'lines' lines
     
    420448    offset=ptr1-in->textbuff;
    421449    if (!ptr2) {
    422       owl_fmtext_append_fmtext(out, in, offset, in->textlen-1);
     450      _owl_fmtext_append_fmtext(out, in, offset, in->textlen-1);
    423451      return(-1);
    424452    }
    425     owl_fmtext_append_fmtext(out, in, offset, (ptr2-ptr1)+offset);
     453    _owl_fmtext_append_fmtext(out, in, offset, (ptr2-ptr1)+offset);
    426454    ptr1=ptr2+1;
    427455  }
     
    430458
    431459
    432 void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out) {
     460void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out)
     461{
    433462  char *ptr1, *ptr2, *last;
    434463  int len, offset;
     
    468497
    469498    offset=ptr1-in->textbuff;
    470     owl_fmtext_append_fmtext(out, in, offset+acol, offset+acol+len);
     499    _owl_fmtext_append_fmtext(out, in, offset+acol, offset+acol+len);
    471500
    472501    ptr1=ptr2+1;
     
    475504
    476505
    477 int owl_fmtext_num_lines(owl_fmtext *f) {
     506int owl_fmtext_num_lines(owl_fmtext *f)
     507{
    478508  int lines, i;
    479509
     
    492522
    493523
    494 char *owl_fmtext_get_text(owl_fmtext *f) {
     524char *owl_fmtext_get_text(owl_fmtext *f)
     525{
    495526  return(f->textbuff);
    496527}
    497528
    498 void owl_fmtext_set_char(owl_fmtext *f, int index, int ch) {
     529void owl_fmtext_set_char(owl_fmtext *f, int index, int ch)
     530{
    499531  /* set the charater at 'index' to be 'char'.  If index is out of
    500532   * bounds don't do anything */
     
    503535}
    504536
    505 void owl_fmtext_free(owl_fmtext *f) {
     537void owl_fmtext_free(owl_fmtext *f)
     538{
    506539  if (f->textbuff) owl_free(f->textbuff);
    507540  if (f->fmbuff) owl_free(f->fmbuff);
     
    510543
    511544
    512 void owl_fmtext_copy(owl_fmtext *dst, owl_fmtext *src) {
     545void owl_fmtext_copy(owl_fmtext *dst, owl_fmtext *src)
     546{
    513547  dst->textlen=src->textlen;
    514548  dst->textbuff=owl_malloc(src->textlen+5);
     
    521555
    522556
    523 int owl_fmtext_search_and_highlight(owl_fmtext *f, char *string) {
    524   /* highlight all instance of "string".  Return the number of
    525    * instances found.  This is case insensitive. */
     557/* highlight all instance of "string".  Return the number of
     558 * instances found.  This is case insensitive.
     559 */
     560int owl_fmtext_search_and_highlight(owl_fmtext *f, char *string)
     561{
    526562
    527563  int found, len;
     
    545581}
    546582
    547 int owl_fmtext_search(owl_fmtext *f, char *string) {
    548   /* return 1 if the string is found, 0 if not.  This is case
    549    *  insensitive */
     583/* return 1 if the string is found, 0 if not.  This is case
     584 *  insensitive
     585 */
     586int owl_fmtext_search(owl_fmtext *f, char *string)
     587{
    550588
    551589  if (stristr(f->textbuff, string)) return(1);
  • functions.c

    r2824f79 r5789230  
    12101210{
    12111211  owl_message *m;
    1212   owl_fmtext fm;
     1212  owl_fmtext fm, attrfm;
    12131213  ZNotice_t *n;
    12141214  char buff[10000], tmpbuff[1024];
     
    12261226  }
    12271227
    1228   owl_fmtext_append_normal(&fm, "Msg Id    : ");
     1228  owl_fmtext_append_bold(&fm, "General Information:\n");
     1229  owl_fmtext_append_normal(&fm, "  Msg Id    : ");
    12291230  sprintf(buff, "%i", owl_message_get_id(m));
    12301231  owl_fmtext_append_normal(&fm, buff);
    12311232  owl_fmtext_append_normal(&fm, "\n");
    12321233
    1233   owl_fmtext_append_normal(&fm, "Type      : ");
     1234  owl_fmtext_append_normal(&fm, "  Type      : ");
    12341235  owl_fmtext_append_bold(&fm, owl_message_type_to_string(m));
    12351236  owl_fmtext_append_normal(&fm, "\n");
    12361237
    12371238  if (owl_message_is_direction_in(m)) {
    1238     owl_fmtext_append_normal(&fm, "Direction : in\n");
     1239    owl_fmtext_append_normal(&fm, "  Direction : in\n");
    12391240  } else if (owl_message_is_direction_out(m)) {
    1240     owl_fmtext_append_normal(&fm, "Direction : out\n");
     1241    owl_fmtext_append_normal(&fm, "  Direction : out\n");
    12411242  } else if (owl_message_is_direction_none(m)) {
    1242     owl_fmtext_append_normal(&fm, "Direction : none\n");
     1243    owl_fmtext_append_normal(&fm, "  Direction : none\n");
    12431244  } else {
    1244     owl_fmtext_append_normal(&fm, "Direction : unknown\n");
    1245   }
    1246 
    1247   owl_fmtext_append_normal(&fm, "Time      : ");
     1245    owl_fmtext_append_normal(&fm, "  Direction : unknown\n");
     1246  }
     1247
     1248  owl_fmtext_append_normal(&fm, "  Time      : ");
    12481249  owl_fmtext_append_normal(&fm, owl_message_get_timestr(m));
    12491250  owl_fmtext_append_normal(&fm, "\n");
    12501251
    12511252  if (!owl_message_is_type_admin(m)) {
    1252     owl_fmtext_append_normal(&fm, "Sender    : ");
     1253    owl_fmtext_append_normal(&fm, "  Sender    : ");
    12531254    owl_fmtext_append_normal(&fm, owl_message_get_sender(m));
    12541255    owl_fmtext_append_normal(&fm, "\n");
    12551256   
    1256     owl_fmtext_append_normal(&fm, "Recipient : ");
     1257    owl_fmtext_append_normal(&fm, "  Recipient : ");
    12571258    owl_fmtext_append_normal(&fm, owl_message_get_recipient(m));
    12581259    owl_fmtext_append_normal(&fm, "\n");
     
    12601261   
    12611262  if (owl_message_is_type_zephyr(m)) {
    1262     owl_fmtext_append_bold(&fm, "  Zephyr Specific Info\n");
     1263    owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n");
    12631264   
    1264     owl_fmtext_append_normal(&fm, "Class     : ");
     1265    owl_fmtext_append_normal(&fm, "  Class     : ");
    12651266    owl_fmtext_append_normal(&fm, owl_message_get_class(m));
    12661267    owl_fmtext_append_normal(&fm, "\n");
    1267     owl_fmtext_append_normal(&fm, "Instance  : ");
     1268    owl_fmtext_append_normal(&fm, "  Instance  : ");
    12681269    owl_fmtext_append_normal(&fm, owl_message_get_instance(m));
    12691270    owl_fmtext_append_normal(&fm, "\n");
    1270     owl_fmtext_append_normal(&fm, "Opcode    : ");
     1271    owl_fmtext_append_normal(&fm, "  Opcode    : ");
    12711272    owl_fmtext_append_normal(&fm, owl_message_get_opcode(m));
    12721273    owl_fmtext_append_normal(&fm, "\n");
    12731274   
    1274     owl_fmtext_append_normal(&fm, "Time      : ");
     1275    owl_fmtext_append_normal(&fm, "  Time      : ");
    12751276    owl_fmtext_append_normal(&fm, owl_message_get_timestr(m));
    12761277    owl_fmtext_append_normal(&fm, "\n");
     
    12791280      n=owl_message_get_notice(m);
    12801281
    1281       owl_fmtext_append_normal(&fm, "Kind      : ");
     1282      owl_fmtext_append_normal(&fm, "  Kind      : ");
    12821283      if (n->z_kind==UNSAFE) {
    12831284        owl_fmtext_append_normal(&fm, "UNSAFE\n");
     
    13011302        owl_fmtext_append_normal(&fm, "ILLEGAL VALUE\n");
    13021303      }
    1303       owl_fmtext_append_normal(&fm, "Host      : ");
     1304      owl_fmtext_append_normal(&fm, "  Host      : ");
    13041305      owl_fmtext_append_normal(&fm, owl_message_get_hostname(m));
    13051306      owl_fmtext_append_normal(&fm, "\n");
    1306       sprintf(buff, "Port      : %i\n", n->z_port);
     1307      sprintf(buff, "  Port      : %i\n", n->z_port);
    13071308      owl_fmtext_append_normal(&fm, buff);
    13081309
    1309       owl_fmtext_append_normal(&fm,    "Auth      : ");
     1310      owl_fmtext_append_normal(&fm,    "  Auth      : ");
    13101311      if (n->z_auth == ZAUTH_FAILED) {
    13111312        owl_fmtext_append_normal(&fm, "FAILED\n");
     
    13191320      }
    13201321
    1321       sprintf(buff, "Checkd Ath: %i\n", n->z_checked_auth);
    1322       sprintf(buff, "%sMulti notc: %s\n", buff, n->z_multinotice);
    1323       sprintf(buff, "%sNum other : %i\n", buff, n->z_num_other_fields);
    1324       sprintf(buff, "%sMsg Len   : %i\n", buff, n->z_message_len);
     1322      /* fix this */
     1323      sprintf(buff, "  Checkd Ath: %i\n", n->z_checked_auth);
     1324      sprintf(buff, "%s  Multi notc: %s\n", buff, n->z_multinotice);
     1325      sprintf(buff, "%s  Num other : %i\n", buff, n->z_num_other_fields);
     1326      sprintf(buff, "%s  Msg Len   : %i\n", buff, n->z_message_len);
    13251327      owl_fmtext_append_normal(&fm, buff);
    13261328     
    1327       sprintf(buff, "Fields    : %i\n", owl_zephyr_get_num_fields(n));
     1329      sprintf(buff, "  Fields    : %i\n", owl_zephyr_get_num_fields(n));
    13281330      owl_fmtext_append_normal(&fm, buff);
    13291331     
    13301332      fields=owl_zephyr_get_num_fields(n);
    13311333      for (i=0; i<fields; i++) {
    1332         sprintf(buff, "Field %i   : ", i+1);
     1334        sprintf(buff, "  Field %i   : ", i+1);
    13331335       
    13341336        ptr=owl_zephyr_get_field(n, i+1, &len);
     
    13521354        owl_fmtext_append_normal(&fm, buff);
    13531355      }
    1354       owl_fmtext_append_normal(&fm, "Default Fm:");
     1356      owl_fmtext_append_normal(&fm, "  Default Fm:");
    13551357      owl_fmtext_append_normal(&fm, n->z_default_format);
    13561358    }
     
    13581360
    13591361  if (owl_message_is_type_aim(m)) {
    1360     owl_fmtext_append_bold(&fm, "  AIM Specific Info\n");   
    1361   }
     1362    owl_fmtext_append_bold(&fm, "\nAIM Specific Information:\n");
     1363  }
     1364
     1365  owl_fmtext_append_bold(&fm, "\nOwl Message Attributes:\n");
     1366  owl_message_attributes_tofmtext(m, &attrfm);
     1367  owl_fmtext_append_fmtext(&fm, &attrfm);
    13621368 
    13631369  owl_function_popless_fmtext(&fm);
     1370  owl_fmtext_free(&fm);
     1371  owl_fmtext_free(&attrfm);
    13641372}
    13651373
     
    17511759      }
    17521760     
    1753       if (owl_message_is_login(m)) {
     1761      if (owl_message_is_loginout(m)) {
    17541762        class="MESSAGE";
    17551763        inst="PERSONAL";
     
    23592367
    23602368  /* narrow personal and login messages to the sender or recip as appropriate */
    2361   if (owl_message_is_personal(m) || owl_message_is_login(m)) {
     2369  if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
    23622370    if (owl_message_is_type_zephyr(m)) {
    23632371      if (owl_message_is_direction_in(m)) {
     
    24062414  /* for now we skip admin messages. */
    24072415  if (owl_message_is_type_admin(m)
    2408       || owl_message_is_login(m)
     2416      || owl_message_is_loginout(m)
    24092417      || !owl_message_is_type_zephyr(m)) {
    24102418    owl_function_makemsg("smartzpunt doesn't support this message type.");
  • message.c

    raa5f725 r5789230  
    7878}
    7979
     80/* We cheat and indent it for now, since we really want this for
     81 * the 'info' function.  Later there should just be a generic
     82 * function to indent fmtext.
     83 */
     84void owl_message_attributes_tofmtext(owl_message *m, owl_fmtext *fm) {
     85  int i, j;
     86  owl_pair *p;
     87  char *buff;
     88
     89  owl_fmtext_init_null(fm);
     90
     91  j=owl_list_get_size(&(m->attributes));
     92  for (i=0; i<j; i++) {
     93    p=owl_list_get_element(&(m->attributes), i);
     94    buff=owl_sprintf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), owl_pair_get_value(p));
     95    owl_fmtext_append_normal(fm, buff);
     96    owl_free(buff);
     97  }
     98}
    8099
    81100owl_fmtext *owl_message_get_fmtext(owl_message *m)
     
    197216  if (!opcode) return("");
    198217  return(opcode);
     218}
     219
     220
     221void owl_message_set_isloginout(owl_message *m)
     222{
     223  owl_message_set_attribute(m, "isloginout", "");
     224}
     225
     226int owl_message_is_loginout(owl_message *m)
     227{
     228  char *res;
     229
     230  res=owl_message_get_attribute_value(m, "isloginout");
     231  if (!res) return(0);
     232  return(1);
     233}
     234
     235void owl_message_set_isprivate(owl_message *m)
     236{
     237  owl_message_set_attribute(m, "isprivate", "");
     238}
     239
     240int owl_message_is_private(owl_message *m)
     241{
     242  char *res;
     243
     244  res=owl_message_get_attribute_value(m, "isprivate");
     245  if (!res) return(0);
     246  return(1);
    199247}
    200248
     
    255303}
    256304
    257 
    258305char *owl_message_get_text(owl_message *m)
    259306{
     
    376423}
    377424
    378 /* true if the message is only intended for one recipient (me) */
    379 int owl_message_is_to_me(owl_message *m)
    380 {
    381   if (owl_message_is_type_zephyr(m)) {
    382     if (!strcasecmp(owl_message_get_recipient(m), ZGetSender())) {
    383       return(1);
    384     } else {
    385       return(0);
    386     }
    387   } else if (owl_message_is_type_aim(m)) {
    388     /* right now we don't support chat rooms */
    389     return(1);
    390   } else if (owl_message_is_type_admin(m)) {
    391     return(1);
    392   }
    393   return(0);
    394 }
    395 
    396 
    397425int owl_message_is_from_me(owl_message *m)
    398426{
     
    418446{
    419447  if (owl_message_is_type_zephyr(m)) {
    420     if (!strcasecmp(owl_message_get_class(m), "mail") && owl_message_is_to_me(m)) {
     448    if (!strcasecmp(owl_message_get_class(m), "mail") && owl_message_is_private(m)) {
    421449      return(1);
    422450    } else {
     
    439467}
    440468
    441 int owl_message_is_login(owl_message *m)
    442 {
    443   if (owl_message_is_type_zephyr(m)) {
    444     if (!strcasecmp(owl_message_get_class(m), "login")) {
    445       return(1);
    446     } else {
    447       return(0);
    448     }
    449   } else if (owl_message_is_type_aim(m)) {
    450     /* deal with this once we can use buddy lists */
    451     return(0);
    452   }
    453        
    454   return(0);
    455 }
    456 
    457469int owl_message_is_burningears(owl_message *m)
    458470{
     
    461473
    462474  /* if the message is from us or to us, it doesn't count */
    463   if (owl_message_is_from_me(m) || owl_message_is_to_me(m)) return(0);
     475  if (owl_message_is_from_me(m) || owl_message_is_private(m)) return(0);
    464476
    465477  if (owl_message_is_type_zephyr(m)) {
     
    539551  owl_message_set_type_aim(m);
    540552  owl_message_set_direction_in(m);
     553
     554  /* for now, all AIM messages are private messages since we don't do chat rooms */
     555  owl_message_set_isprivate(m);
    541556
    542557  indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
     
    593608  owl_message_set_direction_in(m);
    594609
     610  owl_message_set_isloginout(m);
     611
    595612  owl_fmtext_init_null(&(m->fmtext));
    596613  owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR);
     
    666683  } else {
    667684    owl_message_set_realm(m, ZGetRealm());
     685  }
     686
     687  /* Set the "isloginout" attribute if it's a login message */
     688  if (!strcasecmp(n->z_class, "login")) {
     689    owl_message_set_isloginout(m);
     690  }
     691
     692  /* is the "isprivate" attribute if it's a private zephyr */
     693  if (!strcasecmp(n->z_recipient, ZGetSender())) {
     694    owl_message_set_isprivate(m);
    668695  }
    669696
     
    879906  owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR);
    880907
    881   if (!strcasecmp(owl_message_get_opcode(m), "ping") && owl_message_is_to_me(m)) {
     908  if (!strcasecmp(owl_message_get_opcode(m), "ping") && owl_message_is_private(m)) {
    882909    owl_fmtext_append_bold(&(m->fmtext), "PING");
    883910    owl_fmtext_append_normal(&(m->fmtext), " from ");
  • owl.c

    r96f8e5b r5789230  
    1 /* Written by James Kretchmar, MIT
     1/*
    22 *
    33 * Copyright 2001 Massachusetts Institute of Technology
     
    274274
    275275    followlast=owl_global_should_followlast(&g);
     276
     277   
     278    /* If we're logged into AIM, do AIM stuff */
     279    if (owl_global_is_aimloggedin(&g)) {
     280      owl_function_debugmsg("Doing aim processing");
     281      owl_aim_process_events();
     282    }
    276283
    277284    /* little hack */
     
    347354      /* ring the bell if it's a personal */
    348355      if (owl_global_is_personalbell(&g) &&
    349           (owl_message_is_personal(m) ||
    350           (owl_message_is_type_aim(m) && owl_message_is_to_me(m)))) {
     356          !owl_message_is_loginout(m) &&
     357          owl_message_is_private(m)) {
    351358        owl_function_beep();
    352359      }
     
    373380        owl_log_incoming(m);
    374381      }
    375     }
    376 
    377     /* If we're logged into AIM, do AIM stuff */
    378     if (owl_global_is_aimloggedin(&g)) {
    379       owl_function_debugmsg("Doing aim processing");
    380       owl_aim_process_events();
    381382    }
    382383
  • owl_prototypes.h

    r65ad073 r5789230  
    270270extern void owl_fmtext_colorize(owl_fmtext *f, int color);
    271271extern void owl_fmtext_append_ztext(owl_fmtext *f, char *text);
    272 extern void owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in, int start, int stop);
     272extern void _owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in, int start, int stop);
     273extern void owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in);
    273274extern void owl_fmtext_append_spaces(owl_fmtext *f, int nspaces);
    274275extern void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, char *join_with, char *(format_fn)(void*));
     
    580581extern void owl_message_set_attribute(owl_message *m, char *attrname, char *attrvalue);
    581582extern char *owl_message_get_attribute_value(owl_message *m, char *attrname);
     583extern void owl_message_attributes_tofmtext(owl_message *m, owl_fmtext *fm);
    582584extern owl_fmtext *owl_message_get_fmtext(owl_message *m);
    583585extern void owl_message_set_class(owl_message *m, char *class);
     
    597599extern void owl_message_set_opcode(owl_message *m, char *opcode);
    598600extern char *owl_message_get_opcode(owl_message *m);
     601extern void owl_message_set_isloginout(owl_message *m);
     602extern int owl_message_is_loginout(owl_message *m);
     603extern void owl_message_set_isprivate(owl_message *m);
     604extern int owl_message_is_private(owl_message *m);
    599605extern char *owl_message_get_timestr(owl_message *m);
    600606extern void owl_message_set_type_admin(owl_message *m);
     
    623629extern void owl_message_curs_waddstr(owl_message *m, WINDOW *win, int aline, int bline, int acol, int bcol, int color);
    624630extern int owl_message_is_personal(owl_message *m);
    625 extern int owl_message_is_to_me(owl_message *m);
    626631extern int owl_message_is_from_me(owl_message *m);
    627632extern int owl_message_is_mail(owl_message *m);
    628633extern int owl_message_is_ping(owl_message *m);
    629 extern int owl_message_is_login(owl_message *m);
    630634extern int owl_message_is_burningears(owl_message *m);
    631635extern char *owl_message_get_cc(owl_message *m);
Note: See TracChangeset for help on using the changeset viewer.