Changeset d309eb3 for commands.c


Ignore:
Timestamp:
Oct 17, 2002, 3:00:57 PM (22 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:
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
  • commands.c

    r2527615 rd309eb3  
    100100              "-O opcode\n"
    101101              "      Send to the specified opcode\n"),
     102
     103  /*
     104  OWLCMD_ARGS("zcrypt", owl_command_zcrypt, OWL_CTX_INTERACTIVE,
     105              "send an encrypted zephyr",
     106              "zcrypt [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [-m <message...>]\n",
     107              "Behaves like zwrite but uses encryption.  Not for use with\n"
     108              "personal messages\n"),
     109  */
    102110 
    103111  OWLCMD_ARGS("reply", owl_command_reply,  OWL_CTX_INTERACTIVE,
     
    13021310  }
    13031311  return NULL;
     1312}
     1313
     1314char *owl_command_zcrypt(int argc, char **argv, char *buff) {
     1315  char *tmpbuff, *pos, *cmd, *msg;
     1316 
     1317  /* check for a zwrite -m */
     1318  for (pos = buff; *pos; pos = skiptokens(pos, 1)) {
     1319    if (!strncmp(pos, "-m ", 3)) {
     1320      cmd = owl_strdup(buff);
     1321      msg = cmd+(pos-buff);
     1322      *msg = '\0';
     1323      msg += 3;
     1324      owl_zwrite_create_and_send_from_line(cmd, msg);
     1325      owl_free(cmd);
     1326      return NULL;
     1327    }
     1328  }
     1329
     1330  if (argc < 2) {
     1331    owl_function_makemsg("Not enough arguments to the zcrypt command.");
     1332  } else {
     1333    tmpbuff = owl_strdup(buff);
     1334    owl_function_zwrite_setup(tmpbuff);
     1335    owl_global_set_buffercommand(&g, tmpbuff);
     1336    owl_free(tmpbuff);
     1337  }
     1338  return(NULL);
    13041339}
    13051340
Note: See TracChangeset for help on using the changeset viewer.