Changeset d309eb3 for functions.c


Ignore:
Timestamp:
Oct 17, 2002, 3:00:57 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:
e3869df
Parents:
aecf3e6
Message:
Fixed a memory bug in getsubs
Added receive support for zcrypt messages
Added the 'zcrypt' variable which controls whether or not zcrypt
    messages are decrypted
'reply' is disabled for zcrypt until sending zcrypt works
Started implementing zcrypt command
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r8fec514 rd309eb3  
    122122  if (ret) {
    123123    owl_function_makemsg("Error in zwrite arugments");
     124    owl_zwrite_free(&z);
     125    return;
     126  }
     127
     128  /* send a ping if necessary */
     129  if (owl_global_is_txping(&g)) {
     130    owl_zwrite_send_ping(&z);
     131  }
     132  owl_zwrite_free(&z);
     133
     134  /* create and setup the editwin */
     135  e=owl_global_get_typwin(&g);
     136  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_MULTILINE, owl_global_get_msg_history(&g));
     137
     138  if (!owl_global_get_lockout_ctrld(&g)) {
     139    owl_function_makemsg("Type your zephyr below.  End with ^D or a dot on a line by itself.  ^C will quit.");
     140  } else {
     141    owl_function_makemsg("Type your zephyr below.  End with a dot on a line by itself.  ^C will quit.");
     142  }
     143
     144  owl_editwin_clear(e);
     145  owl_editwin_set_dotsend(e);
     146  strcpy(buff, "----> ");
     147  strcat(buff, line);
     148  strcat(buff, "\n");
     149  owl_editwin_set_locktext(e, buff);
     150
     151  /* make it active */
     152  owl_global_set_typwin_active(&g);
     153}
     154
     155void owl_function_zcrypt_setup(char *line) {
     156  owl_editwin *e;
     157  char buff[1024];
     158  owl_zwrite z;
     159  int ret;
     160
     161  /* check the arguments */
     162  ret=owl_zwrite_create_from_line(&z, line);
     163  if (ret) {
     164    owl_function_makemsg("Error in zwrite arugments");
     165    owl_zwrite_free(&z);
     166    return;
     167  }
     168
     169  if (owl_zwrite_get_numrecips(&z)>0) {
     170    owl_function_makemsg("You may not specifiy a recipient for a zcrypt message");
    124171    owl_zwrite_free(&z);
    125172    return;
     
    12951342
    12961343  buff=owl_malloc(num*500);
    1297   tmpbuff=owl_malloc(2048);
     1344  tmpbuff=owl_malloc(num*500);
    12981345  strcpy(buff, "");
    12991346  for (i=0; i<num; i++) {
     
    15121559        return;
    15131560      }
     1561    }
     1562
     1563    /* for now we disable replies to zcrypt messages, since we can't
     1564       support an encrypted reply */
     1565    if (!strcasecmp(owl_message_get_opcode(m), "crypt")) {
     1566      owl_function_makemsg("Replies to zcrypt messages are not enabled in this release");
     1567      return;
    15141568    }
    15151569
Note: See TracChangeset for help on using the changeset viewer.