Changeset 778d0a9


Ignore:
Timestamp:
Jun 27, 2003, 10:41:01 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
290f290
Parents:
94e4899
Message:
Added hostname and tty name to LOGIN/LOGOUT zephyrs on oneline style
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r94e4899 r778d0a9  
    1010        AIM logout and then login now works.
    1111        Fixed bug causing view -d not to work.
     12        Added hostname and tty name to LOGIN/LOGOUT zephyrs on oneline
     13          style
    1214       
    13152.0.4
  • stylefunc.c

    r9c4ec91 r778d0a9  
    4444      owl_fmtext_append_normal(fm, "\n");
    4545    } else if (owl_message_is_loginout(m)) {
    46       char *ptr, host[LINE], tty[LINE];
     46      char *ptr, *host, *tty;
    4747      int len;
    48      
     48
    4949      ptr=owl_zephyr_get_field(n, 1, &len);
     50      host=owl_malloc(len+10);
    5051      strncpy(host, ptr, len);
    5152      host[len]='\0';
     53
    5254      ptr=owl_zephyr_get_field(n, 3, &len);
     55      tty=owl_malloc(len+10);
    5356      strncpy(tty, ptr, len);
    5457      tty[len]='\0';
     
    6871      owl_fmtext_append_normal(fm, tty);
    6972      owl_fmtext_append_normal(fm, "\n");
     73
     74      owl_free(host);
     75      owl_free(tty);
    7076    } else {
    7177      owl_fmtext_append_normal(fm, "From: ");
     
    229235      owl_fmtext_append_normal(fm, "\n");
    230236    } else if (owl_message_is_loginout(m)) {
    231       char *ptr, host[LINE], tty[LINE];
     237      char *ptr, *host, *tty;
    232238      int len;
    233      
     239
    234240      ptr=owl_zephyr_get_field(n, 1, &len);
     241      host=owl_malloc(len+10);
    235242      strncpy(host, ptr, len);
    236243      host[len]='\0';
     244
    237245      ptr=owl_zephyr_get_field(n, 3, &len);
     246      tty=owl_malloc(len+10);
    238247      strncpy(tty, ptr, len);
    239248      tty[len]='\0';
     
    253262      owl_fmtext_append_normal(fm, tty);
    254263      owl_fmtext_append_normal(fm, "\n");
     264
     265      owl_free(host);
     266      owl_free(tty);
    255267    } else {
    256268      owl_fmtext_append_normal(fm, owl_message_get_class(m));
     
    383395  char *baseformat="%s %-13.13s %-11.11s %-12.12s ";
    384396  char *sender, *recip;
     397  ZNotice_t *n;
     398
    385399
    386400  sender=short_zuser(owl_message_get_sender(m));
     
    388402 
    389403  if (owl_message_is_type_zephyr(m)) {
     404    n=owl_message_get_notice(m);
     405   
    390406    owl_fmtext_append_spaces(fm, OWL_TAB);
    391     if (owl_message_is_login(m)) {
    392       tmp=owl_sprintf(baseformat, "<", "LOGIN", "", sender);
    393       owl_fmtext_append_normal(fm, tmp);
    394       owl_fmtext_append_normal(fm, "\n");
    395       owl_free(tmp);
    396     } else if (owl_message_is_logout(m)) {
    397       tmp=owl_sprintf(baseformat, "<", "LOGOUT", "", sender);
    398       owl_fmtext_append_normal(fm, tmp);
    399       owl_fmtext_append_normal(fm, "\n");
    400       owl_free(tmp);
     407
     408    if (owl_message_is_loginout(m)) {
     409      char *ptr, *host, *tty;
     410      int len;
     411     
     412      ptr=owl_zephyr_get_field(n, 1, &len);
     413      host=owl_malloc(len+10);
     414      strncpy(host, ptr, len);
     415      host[len]='\0';
     416
     417      ptr=owl_zephyr_get_field(n, 3, &len);
     418      tty=owl_malloc(len+10);
     419      strncpy(tty, ptr, len);
     420      tty[len]='\0';
     421
     422      if (owl_message_is_login(m)) {
     423        tmp=owl_sprintf(baseformat, "<", "LOGIN", "", sender);
     424        owl_fmtext_append_normal(fm, tmp);
     425        owl_free(tmp);
     426      } else if (owl_message_is_logout(m)) {
     427        tmp=owl_sprintf(baseformat, "<", "LOGOUT", "", sender);
     428        owl_fmtext_append_normal(fm, tmp);
     429        owl_free(tmp);
     430      }
     431
     432      owl_fmtext_append_normal(fm, "at ");
     433      owl_fmtext_append_normal(fm, host);
     434      owl_fmtext_append_normal(fm, " ");
     435      owl_fmtext_append_normal(fm, tty);
     436      owl_fmtext_append_normal(fm, "\n");
     437
     438      owl_free(host);
     439      owl_free(tty);
     440
    401441    } else if (owl_message_is_ping(m)) {
    402442      tmp=owl_sprintf(baseformat, "<", "PING", "", sender);
     
    404444      owl_fmtext_append_normal(fm, "\n");
    405445      owl_free(tmp);
     446
    406447    } else {
    407448      if (owl_message_is_direction_in(m)) {
Note: See TracChangeset for help on using the changeset viewer.