Changes in message.c [147d880:f34dd65]
Legend:
- Unmodified
- Added
- Removed
-
message.c
r147d880 rf34dd65 338 338 } 339 339 340 /* caller must free the return */341 char *owl_message_get_shorttimestr(owl_message *m)342 {343 struct tm *tmstruct;344 char *out;345 346 tmstruct=localtime(&(m->time));347 out=owl_sprintf("%2.2i:%2.2i", tmstruct->tm_hour, tmstruct->tm_min);348 if (out) return(out);349 return("??:??");350 }351 352 340 void owl_message_set_type_admin(owl_message *m) 353 341 { … … 384 372 { 385 373 return owl_message_is_type(m, "admin"); 386 }387 388 int owl_message_is_type_generic(owl_message *m)389 {390 char * t = owl_message_get_attribute_value(m, "type");391 return (t == NULL);392 374 } 393 375 … … 573 555 } 574 556 575 int owl_message_is_from_me(owl_message *m)576 {577 if (owl_message_is_type_zephyr(m)) {578 if (!strcasecmp(owl_message_get_sender(m), owl_zephyr_get_sender())) {579 return(1);580 } else {581 return(0);582 }583 } else if (owl_message_is_type_aim(m)) {584 if (!strcasecmp(owl_message_get_sender(m), owl_global_get_aim_screenname(&g))) {585 return(1);586 } else {587 return(0);588 }589 } else if (owl_message_is_type_admin(m)) {590 return(0);591 }592 return(0);593 }594 595 557 int owl_message_is_mail(owl_message *m) 596 558 { 597 559 if (owl_message_is_type_zephyr(m)) { 598 560 if (!strcasecmp(owl_message_get_class(m), "mail") && owl_message_is_private(m)) { 599 return(1);600 } else {601 return(0);602 }603 }604 return(0);605 }606 607 int owl_message_is_ping(owl_message *m)608 {609 if (owl_message_is_type_zephyr(m)) {610 if (!strcasecmp(owl_message_get_opcode(m), "ping")) {611 561 return(1); 612 562 } else { … … 964 914 owl_message_set_instance(m, owl_zwrite_get_instance(&z)); 965 915 if (owl_zwrite_get_numrecips(&z)>0) { 916 char *longzuser = long_zuser(owl_zwrite_get_recip_n(&z, 0)); 966 917 owl_message_set_recipient(m, 967 long_zuser(owl_zwrite_get_recip_n(&z, 0))); /* only gets the first user, must fix */ 918 longzuser); /* only gets the first user, must fix */ 919 owl_free(longzuser); 968 920 } 969 921 owl_message_set_opcode(m, owl_zwrite_get_opcode(&z)); … … 990 942 } 991 943 992 void owl_message_pretty_zsig(owl_message *m, char *buff)993 {994 /* stick a one line version of the zsig in buff */995 char *ptr;996 997 strcpy(buff, owl_message_get_zsig(m));998 ptr=strchr(buff, '\n');999 if (ptr) ptr[0]='\0';1000 }1001 1002 944 void owl_message_free(owl_message *m) 1003 945 {
Note: See TracChangeset
for help on using the changeset viewer.