Changeset ce7db4d for functions.c


Ignore:
Timestamp:
Jun 24, 2003, 11:12:09 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
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:
658dc2f
Parents:
723c427
Message:
zwrite -m now logs and displays an outgoing message
zwrite -s now works
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rf1cbb7a rce7db4d  
    302302}
    303303
    304 void owl_function_zwrite(char *line)
     304/* send, log and display an outgoing zephyr.  If 'msg' is NULL
     305 * the message is expected to be set from the zwrite line itself
     306 */
     307void owl_function_zwrite(char *line, char *msg)
    305308{
    306309  owl_zwrite z;
    307310  int i, j;
     311  char *mymsg;
    308312
    309313  /* create the zwrite and send the message */
    310314  owl_zwrite_create_from_line(&z, line);
    311   owl_zwrite_send_message(&z, owl_editwin_get_text(owl_global_get_typwin(&g)));
     315  if (msg) {
     316    owl_zwrite_set_message(&z, msg);
     317  }
     318
     319  owl_zwrite_send_message(&z);
    312320  owl_function_makemsg("Waiting for ack...");
     321
     322  mymsg=owl_zwrite_get_message(&z);
    313323
    314324  /* display the message as an outgoing message in the receive window */
    315325  if (owl_global_is_displayoutgoing(&g) && owl_zwrite_is_personal(&z)) {
    316     owl_function_make_outgoing_zephyr(owl_editwin_get_text(owl_global_get_typwin(&g)), line, owl_zwrite_get_zsig(&z));
     326    owl_function_make_outgoing_zephyr(mymsg, line, owl_zwrite_get_zsig(&z));
    317327  }
    318328
     
    321331    j=owl_zwrite_get_numrecips(&z);
    322332    for (i=0; i<j; i++) {
    323       owl_log_outgoing_zephyr(owl_zwrite_get_recip_n(&z, i),
    324                        owl_editwin_get_text(owl_global_get_typwin(&g)));
     333      owl_log_outgoing_zephyr(owl_zwrite_get_recip_n(&z, i), mymsg);
    325334    }
    326335  }
     
    10731082  buff=owl_global_get_buffercommand(&g);
    10741083  if (!strncmp(buff, "zwrite ", 7)) {
    1075     owl_function_zwrite(buff);
     1084    owl_function_zwrite(buff, owl_editwin_get_text(owl_global_get_typwin(&g)));
    10761085  } else if (!strncmp(buff, "aimwrite ", 9)) {
    10771086    owl_function_aimwrite(buff+9);
Note: See TracChangeset for help on using the changeset viewer.