Changeset b45293f for functions.c


Ignore:
Timestamp:
Oct 11, 2002, 11:56:23 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
68b41b0
Parents:
2adaf1d
Message:
Outgoing messages now go through the config for formatting
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r2adaf1d rb45293f  
    8282}
    8383
    84 void owl_function_make_outgoing_zephyr(char *header, char *body, char *zwriteline, char *zsig) {
     84void owl_function_make_outgoing_zephyr(char *body, char *zwriteline, char *zsig) {
    8585  owl_message *m;
    8686  int followlast;
    8787  owl_zwrite z;
    88   char *tobuff, *recip;
    8988 
    9089  followlast=owl_global_should_followlast(&g);
     
    9392  owl_zwrite_create_from_line(&z, zwriteline);
    9493
    95   /* in 'tobuff' place the "Message sent to foo" string.
    96    * Right now this only works for one recipient */
    97   tobuff=owl_malloc(strlen(owl_zwrite_get_recip_n(&z, 0))+100);
    98   sprintf(tobuff, "Zephyr sent to %s  (Zsig: %s)", owl_zwrite_get_recip_n(&z, 0), zsig);
    99 
    10094  /* create the message */
    10195  m=owl_malloc(sizeof(owl_message));
    102   owl_message_create(m,  tobuff, body);
    103   owl_message_set_direction_out(m);
    104   owl_message_set_type_zephyr(m);
    105 
    106   /* set zwriteline */
    107   owl_message_set_zwriteline(m, zwriteline);
    108 
    109   owl_message_set_class(m, owl_zwrite_get_class(&z));
    110   owl_message_set_instance(m, owl_zwrite_get_instance(&z));
    111   owl_message_set_opcode(m, owl_zwrite_get_opcode(&z));
    112   owl_message_set_realm(m, owl_zwrite_get_realm(&z));
    113   owl_message_set_sender(m, ZGetSender());
    114   /* this only gets the first recipient for now, must fix */
    115   recip=long_zuser(owl_zwrite_get_recip_n(&z, 0));
    116   owl_message_set_recipient(m, recip);
    117   owl_free(recip);
     96  owl_message_create_from_zwriteline(m, zwriteline, body, zsig);
    11897
    11998  /* add it to the global list */
     
    130109  wnoutrefresh(owl_global_get_curs_recwin(&g));
    131110  owl_global_set_needrefresh(&g);
    132   owl_free(tobuff);
    133111  owl_zwrite_free(&z);
    134112}
     
    176154
    177155void owl_function_zwrite(char *line) {
    178   char *tmpbuff, buff[1024];
     156  char buff[1024];
    179157  owl_zwrite z;
    180158  int i, j;
     
    188166  if (owl_global_is_displayoutgoing(&g) && owl_zwrite_is_personal(&z)) {
    189167    owl_zwrite_get_recipstr(&z, buff);
    190     tmpbuff = owl_sprintf("Message sent to %s", buff);
    191     owl_function_make_outgoing_zephyr(tmpbuff, owl_editwin_get_text(owl_global_get_typwin(&g)), line, owl_zwrite_get_zsig(&z));
    192     owl_free(tmpbuff);
     168    owl_function_make_outgoing_zephyr(owl_editwin_get_text(owl_global_get_typwin(&g)), line, owl_zwrite_get_zsig(&z));
    193169  }
    194170
     
    953929  if (owl_global_is_bell(&g)) {
    954930    beep();
     931    owl_global_set_needrefresh(&g); /* do we really need this? */
    955932  }
    956933}
Note: See TracChangeset for help on using the changeset viewer.