Changeset 8b32593 for stylefunc.c
- Timestamp:
- Jun 10, 2003, 9:15:15 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:
- b97fce8
- Parents:
- f14a7ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylefunc.c
rbd3f232 r8b32593 34 34 owl_fmtext_append_normal(fm, OWL_TABSTR); 35 35 36 if ( !strcasecmp(owl_message_get_opcode(m), "ping")) {36 if (owl_message_is_ping(m)) { 37 37 owl_fmtext_append_bold(fm, "PING"); 38 38 owl_fmtext_append_normal(fm, " from "); 39 39 owl_fmtext_append_bold(fm, frombuff); 40 40 owl_fmtext_append_normal(fm, "\n"); 41 } else if ( !strcasecmp(owl_message_get_class(m), "login")) {41 } else if (owl_message_is_loginout(m)) { 42 42 char *ptr, host[LINE], tty[LINE]; 43 43 int len; … … 49 49 strncpy(tty, ptr, len); 50 50 tty[len]='\0'; 51 52 if ( !strcasecmp(owl_message_get_opcode(m), "user_login")) {51 52 if (owl_message_is_login(m)) { 53 53 owl_fmtext_append_bold(fm, "LOGIN"); 54 } else if ( !strcasecmp(owl_message_get_opcode(m), "user_logout")) {54 } else if (owl_message_is_logout(m)) { 55 55 owl_fmtext_append_bold(fm, "LOGOUT"); 56 56 } … … 225 225 owl_fmtext_append_normal(fm, OWL_TABSTR); 226 226 227 if ( !strcasecmp(owl_message_get_opcode(m), "ping") && owl_message_is_private(m)) {227 if (owl_message_is_ping(m) && owl_message_is_private(m)) { 228 228 owl_fmtext_append_bold(fm, "PING"); 229 229 owl_fmtext_append_normal(fm, " from "); 230 230 owl_fmtext_append_bold(fm, frombuff); 231 231 owl_fmtext_append_normal(fm, "\n"); 232 } else if ( !strcasecmp(n->z_class, "login")) {232 } else if (owl_message_is_loginout(m)) { 233 233 char *ptr, host[LINE], tty[LINE]; 234 234 int len; … … 241 241 tty[len]='\0'; 242 242 243 if ( !strcasecmp(n->z_opcode, "user_login")) {243 if (owl_message_is_login(m)) { 244 244 owl_fmtext_append_bold(fm, "LOGIN"); 245 } else if ( !strcasecmp(n->z_opcode, "user_logout")) {245 } else if (owl_message_is_logout(m)) { 246 246 owl_fmtext_append_bold(fm, "LOGOUT"); 247 247 } … … 384 384 } 385 385 } 386 387 void owl_stylefunc_oneline(owl_fmtext *fm, owl_message *m) 388 { 389 char *tmp; 390 391 if (owl_message_is_type_zephyr(m)) { 392 owl_fmtext_append_spaces(fm, OWL_TAB); 393 if (owl_message_is_login(m)) { 394 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", "LOGIN", "", owl_message_get_sender(m)); 395 owl_fmtext_append_normal(fm, tmp); 396 owl_fmtext_append_normal(fm, "\n"); 397 if (tmp) owl_free(tmp); 398 } else if (owl_message_is_logout(m)) { 399 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", "LOGOUT", "", owl_message_get_sender(m)); 400 owl_fmtext_append_normal(fm, tmp); 401 owl_fmtext_append_normal(fm, "\n"); 402 if (tmp) owl_free(tmp); 403 } else if (owl_message_is_ping(m)) { 404 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", "PING", "", owl_message_get_sender(m)); 405 owl_fmtext_append_normal(fm, tmp); 406 owl_fmtext_append_normal(fm, "\n"); 407 if (tmp) owl_free(tmp); 408 } else { 409 if (owl_message_is_direction_in(m)) { 410 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", owl_message_get_class(m), owl_message_get_instance(m), owl_message_get_sender(m)); 411 } else if (owl_message_is_direction_out(m)) { 412 tmp=owl_sprintf("> %-15.15s %-15.15s %-12.12s ", owl_message_get_class(m), owl_message_get_instance(m), owl_message_get_recipient(m)); 413 } else { 414 tmp=owl_sprintf("- %-15.15s %-15.15s %-12.12s ", owl_message_get_class(m), owl_message_get_instance(m), owl_message_get_sender(m)); 415 } 416 owl_fmtext_append_normal(fm, tmp); 417 if (tmp) owl_free(tmp); 418 419 tmp=owl_strdup(owl_message_get_body(m)); 420 owl_util_tr(tmp, '\n', ' '); 421 owl_fmtext_append_normal(fm, tmp); 422 owl_fmtext_append_normal(fm, "\n"); 423 if (tmp) owl_free(tmp); 424 } 425 426 /* make personal messages bold for smaat users */ 427 if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES) && owl_message_is_personal(m)) { 428 owl_fmtext_addattr(fm, OWL_FMTEXT_ATTR_BOLD); 429 } 430 431 } else if (owl_message_is_type_aim(m)) { 432 owl_fmtext_append_spaces(fm, OWL_TAB); 433 if (owl_message_is_login(m)) { 434 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", "AIM LOGIN", "", owl_message_get_sender(m)); 435 owl_fmtext_append_normal(fm, tmp); 436 owl_fmtext_append_normal(fm, "\n"); 437 if (tmp) owl_free(tmp); 438 } else if (owl_message_is_logout(m)) { 439 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", "AIM LOGOUT", "", owl_message_get_sender(m)); 440 owl_fmtext_append_normal(fm, tmp); 441 owl_fmtext_append_normal(fm, "\n"); 442 if (tmp) owl_free(tmp); 443 } else { 444 if (owl_message_is_direction_in(m)) { 445 tmp=owl_sprintf("< %-15.15s %-15.15s %-12.12s ", "AIM", "", owl_message_get_sender(m)); 446 owl_fmtext_append_normal(fm, tmp); 447 if (tmp) owl_free(tmp); 448 } else if (owl_message_is_direction_out(m)) { 449 tmp=owl_sprintf("> %-15.15s %-15.15s %-12.12s ", "AIM", "", owl_message_get_recipient(m)); 450 owl_fmtext_append_normal(fm, tmp); 451 if (tmp) owl_free(tmp); 452 } 453 454 tmp=owl_strdup(owl_message_get_body(m)); 455 owl_util_tr(tmp, '\n', ' '); 456 owl_fmtext_append_normal(fm, tmp); 457 owl_fmtext_append_normal(fm, "\n"); 458 if (tmp) owl_free(tmp); 459 } 460 461 /* make personal messages bold for smaat users */ 462 if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) { 463 owl_fmtext_addattr(fm, OWL_FMTEXT_ATTR_BOLD); 464 } 465 } else if (owl_message_is_type_admin(m)) { 466 owl_fmtext_append_spaces(fm, OWL_TAB); 467 owl_fmtext_append_normal(fm, "< ADMIN "); 468 469 tmp=owl_strdup(owl_message_get_body(m)); 470 owl_util_tr(tmp, '\n', ' '); 471 owl_fmtext_append_normal(fm, tmp); 472 owl_fmtext_append_normal(fm, "\n"); 473 if (tmp) owl_free(tmp); 474 } 475 476 }
Note: See TracChangeset
for help on using the changeset viewer.