Changeset 5a95b69 for stylefunc.c
- Timestamp:
- Dec 20, 2003, 1:35:36 PM (21 years ago)
- 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:
- 72836b5
- Parents:
- c8735aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylefunc.c
r97cd00be r5a95b69 47 47 owl_fmtext_append_normal(fm, "\n"); 48 48 } else if (owl_message_is_loginout(m)) { 49 char *ptr, *host, *tty; 50 int len; 51 52 ptr=owl_zephyr_get_field(n, 1, &len); 53 host=owl_malloc(len+10); 54 strncpy(host, ptr, len); 55 host[len]='\0'; 56 57 ptr=owl_zephyr_get_field(n, 3, &len); 58 tty=owl_malloc(len+10); 59 strncpy(tty, ptr, len); 60 tty[len]='\0'; 61 49 char *host, *tty; 50 51 host=owl_message_get_attribute_value(m, "loginhost"); 52 tty=owl_message_get_attribute_value(m, "logintty"); 53 62 54 if (owl_message_is_login(m)) { 63 55 owl_fmtext_append_bold(fm, "LOGIN"); 64 56 } else if (owl_message_is_logout(m)) { 65 57 owl_fmtext_append_bold(fm, "LOGOUT"); 58 } 59 if (owl_message_is_pseudo(m)) { 60 owl_fmtext_append_bold(fm, " (PSEUDO)"); 66 61 } 67 62 owl_fmtext_append_normal(fm, " for "); … … 70 65 owl_free(ptr); 71 66 owl_fmtext_append_normal(fm, " at "); 72 owl_fmtext_append_normal(fm, host );67 owl_fmtext_append_normal(fm, host ? host : ""); 73 68 owl_fmtext_append_normal(fm, " "); 74 owl_fmtext_append_normal(fm, tty); 75 owl_fmtext_append_normal(fm, "\n"); 76 77 owl_free(host); 78 owl_free(tty); 69 owl_fmtext_append_normal(fm, tty ? tty : ""); 70 owl_fmtext_append_normal(fm, "\n"); 79 71 } else { 80 72 owl_fmtext_append_normal(fm, "From: "); … … 266 258 owl_fmtext_append_normal(fm, "\n"); 267 259 } else if (owl_message_is_loginout(m)) { 268 char *ptr, *host, *tty; 269 int len; 270 271 ptr=owl_zephyr_get_field(n, 1, &len); 272 host=owl_malloc(len+10); 273 strncpy(host, ptr, len); 274 host[len]='\0'; 275 276 ptr=owl_zephyr_get_field(n, 3, &len); 277 tty=owl_malloc(len+10); 278 strncpy(tty, ptr, len); 279 tty[len]='\0'; 260 char *host, *tty; 261 262 host=owl_message_get_attribute_value(m, "loginhost"); 263 tty=owl_message_get_attribute_value(m, "logintty"); 280 264 281 265 if (owl_message_is_login(m)) { … … 284 268 owl_fmtext_append_bold(fm, "LOGOUT"); 285 269 } 270 271 if (owl_message_is_pseudo(m)) owl_fmtext_append_bold(fm, " (PSEUDO)"); 272 286 273 owl_fmtext_append_normal(fm, " for "); 287 274 ptr=short_zuser(owl_message_get_instance(m)); … … 289 276 owl_free(ptr); 290 277 owl_fmtext_append_normal(fm, " at "); 291 owl_fmtext_append_normal(fm, host );278 owl_fmtext_append_normal(fm, host ? host : ""); 292 279 owl_fmtext_append_normal(fm, " "); 293 owl_fmtext_append_normal(fm, tty );280 owl_fmtext_append_normal(fm, tty ? tty : ""); 294 281 owl_fmtext_append_normal(fm, " "); 295 282 owl_fmtext_append_normal(fm, shorttimestr); 296 283 owl_fmtext_append_normal(fm, "\n"); 297 298 owl_free(host);299 owl_free(tty);300 284 } else { 301 285 owl_fmtext_append_normal(fm, owl_message_get_class(m)); … … 482 466 483 467 if (owl_message_is_loginout(m)) { 484 char *ptr, *host, *tty; 485 int len; 486 487 ptr=owl_zephyr_get_field(n, 1, &len); 488 host=owl_malloc(len+10); 489 strncpy(host, ptr, len); 490 host[len]='\0'; 491 492 ptr=owl_zephyr_get_field(n, 3, &len); 493 tty=owl_malloc(len+10); 494 strncpy(tty, ptr, len); 495 tty[len]='\0'; 468 char *host, *tty; 469 470 host=owl_message_get_attribute_value(m, "loginhost"); 471 tty=owl_message_get_attribute_value(m, "logintty"); 496 472 497 473 if (owl_message_is_login(m)) { 498 tmp=owl_sprintf(baseformat, "<", "LOGIN", "", sender);474 tmp=owl_sprintf(baseformat, "<", owl_message_is_pseudo(m)?"LOGIN-P":"LOGIN", "", sender); 499 475 owl_fmtext_append_normal(fm, tmp); 500 476 owl_free(tmp); 501 477 } else if (owl_message_is_logout(m)) { 502 tmp=owl_sprintf(baseformat, "<", "LOGOUT", "", sender);478 tmp=owl_sprintf(baseformat, "<", owl_message_is_pseudo(m)?"LOGOUT-P":"LOGOUT", "", sender); 503 479 owl_fmtext_append_normal(fm, tmp); 504 480 owl_free(tmp); … … 506 482 507 483 owl_fmtext_append_normal(fm, "at "); 508 owl_fmtext_append_normal(fm, host );484 owl_fmtext_append_normal(fm, host ? host : ""); 509 485 owl_fmtext_append_normal(fm, " "); 510 owl_fmtext_append_normal(fm, tty); 511 owl_fmtext_append_normal(fm, "\n"); 512 513 owl_free(host); 514 owl_free(tty); 486 owl_fmtext_append_normal(fm, tty ? tty : ""); 487 owl_fmtext_append_normal(fm, "\n"); 515 488 516 489 } else if (owl_message_is_ping(m)) { … … 664 637 owl_fmtext_append_normal(fm, "\n"); 665 638 } else if (owl_message_is_loginout(m)) { 666 char *ptr, *host, *tty; 667 int len; 668 669 ptr=owl_zephyr_get_field(n, 1, &len); 670 host=owl_malloc(len+10); 671 strncpy(host, ptr, len); 672 host[len]='\0'; 673 674 ptr=owl_zephyr_get_field(n, 3, &len); 675 tty=owl_malloc(len+10); 676 strncpy(tty, ptr, len); 677 tty[len]='\0'; 639 char *host, *tty; 640 641 host=owl_message_get_attribute_value(m, "loginhost"); 642 tty=owl_message_get_attribute_value(m, "logintty"); 678 643 679 644 if (owl_message_is_login(m)) { … … 682 647 owl_fmtext_append_bold(fm, "LOGOUT"); 683 648 } 649 if (owl_message_is_pseudo(m)) owl_fmtext_append_bold(fm, " (PSEUDO)"); 650 684 651 owl_fmtext_append_normal(fm, " for "); 685 652 ptr=short_zuser(owl_message_get_instance(m)); … … 687 654 owl_free(ptr); 688 655 owl_fmtext_append_normal(fm, " at "); 689 owl_fmtext_append_normal(fm, host );656 owl_fmtext_append_normal(fm, host ? host : ""); 690 657 owl_fmtext_append_normal(fm, " "); 691 owl_fmtext_append_normal(fm, tty); 692 owl_fmtext_append_normal(fm, "\n"); 693 694 owl_free(host); 695 owl_free(tty); 658 owl_fmtext_append_normal(fm, tty ? tty : ""); 659 owl_fmtext_append_normal(fm, "\n"); 696 660 } else { 697 661 owl_fmtext_append_normal(fm, sender);
Note: See TracChangeset
for help on using the changeset viewer.