Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r147d880 rf34dd65  
    338338}
    339339
    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 
    352340void owl_message_set_type_admin(owl_message *m)
    353341{
     
    384372{
    385373  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);
    392374}
    393375
     
    573555}
    574556
    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 
    595557int owl_message_is_mail(owl_message *m)
    596558{
    597559  if (owl_message_is_type_zephyr(m)) {
    598560    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")) {
    611561      return(1);
    612562    } else {
     
    964914  owl_message_set_instance(m, owl_zwrite_get_instance(&z));
    965915  if (owl_zwrite_get_numrecips(&z)>0) {
     916    char *longzuser = long_zuser(owl_zwrite_get_recip_n(&z, 0));
    966917    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);
    968920  }
    969921  owl_message_set_opcode(m, owl_zwrite_get_opcode(&z));
     
    990942}
    991943
    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 
    1002944void owl_message_free(owl_message *m)
    1003945{
Note: See TracChangeset for help on using the changeset viewer.