Changeset 85d1795 for message.c


Ignore:
Timestamp:
Apr 16, 2007, 9:54:27 PM (17 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
d754b0a
Parents:
1d7e094
Message:
Change special casing rules to refer to default format strings instead
of senders.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    ra387d12e r85d1795  
    851851  m->zwriteline=strdup("");
    852852
    853   /* set the body */
    854   tmp=owl_zephyr_get_message(n);
    855   if (owl_global_is_newlinestrip(&g)) {
    856     tmp2=owl_util_stripnewlines(tmp);
    857     owl_message_set_body(m, tmp2);
    858     owl_free(tmp2);
    859   } else {
    860     owl_message_set_body(m, tmp);
    861   }
    862   owl_free(tmp);
    863 
    864 #ifdef OWL_ENABLE_ZCRYPT
    865   /* if zcrypt is enabled try to decrypt the message */
    866   if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
    867     char *out;
    868     int ret;
    869 
    870     out=owl_malloc(strlen(owl_message_get_body(m))*16+20);
    871     ret=owl_zcrypt_decrypt(out, owl_message_get_body(m), owl_message_get_class(m), owl_message_get_instance(m));
    872     if (ret==0) {
    873       owl_message_set_body(m, out);
    874     } else {
    875       owl_free(out);
    876     }
    877   }
    878 #endif 
    879 
    880853  /* save the hostname */
    881854  owl_function_debugmsg("About to do gethostbyaddr");
     
    886859    owl_message_set_hostname(m, inet_ntoa(n->z_sender_addr));
    887860  }
     861
     862  /* set the body */
     863  tmp=owl_zephyr_get_message(n, m);
     864  if (owl_global_is_newlinestrip(&g)) {
     865    tmp2=owl_util_stripnewlines(tmp);
     866    owl_message_set_body(m, tmp2);
     867    owl_free(tmp2);
     868  } else {
     869    owl_message_set_body(m, tmp);
     870  }
     871  owl_free(tmp);
     872
     873#ifdef OWL_ENABLE_ZCRYPT
     874  /* if zcrypt is enabled try to decrypt the message */
     875  if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
     876    char *out;
     877    int ret;
     878
     879    out=owl_malloc(strlen(owl_message_get_body(m))*16+20);
     880    ret=owl_zcrypt_decrypt(out, owl_message_get_body(m), owl_message_get_class(m), owl_message_get_instance(m));
     881    if (ret==0) {
     882      owl_message_set_body(m, out);
     883    } else {
     884      owl_free(out);
     885    }
     886  }
     887#endif 
    888888}
    889889#else
Note: See TracChangeset for help on using the changeset viewer.