Changeset 453bd70


Ignore:
Timestamp:
Jul 2, 2003, 3:24:51 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:
7c9c847
Parents:
cf83b7a
Message:
aimlogin will now accept the screenname without a password and ask
   for the password such that it is not echo'd to the terminal
Fixed documentation bug in aimwrite
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rcf83b7a r453bd70  
    332.0.6-pre-2
    44        Started adding code to do question/response stuff
     5        aimlogin will now accept the screenname without a password and ask
     6           for the password such that it is not echo'd to the terminal
     7        Fixed documentation bug in aimwrite
    58
    692.0.6-pre-1
  • commands.c

    rcf83b7a r453bd70  
    8181              "prompts the user to enter a response to some question",
    8282              "start-command <question>",
     83              ""),
     84
     85  OWLCMD_ARGS("start-password", owl_command_start_password, OWL_CTX_INTERACTIVE,
     86              "prompts the user to enter a password",
     87              "start-password <question>",
    8388              ""),
    8489
     
    118123
    119124  OWLCMD_ARGS("aimwrite", owl_command_aimwrite, OWL_CTX_INTERACTIVE,
    120               "send a zephyr",
     125              "send an AIM message",
    121126              "aimzwrite <user>",
    122127              "Send an aim message to a user.\n"),
     
    640645  OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY,
    641646              "login to an AIM account",
    642               "aimlogin <screenname> <password>\n",
     647              "aimlogin <screenname> [<password>]\n",
    643648              ""),
    644649
     
    12241229}
    12251230
     1231char *owl_command_start_password(int argc, char **argv, char *buff)
     1232{
     1233  buff = skiptokens(buff, 1);
     1234  owl_function_start_password(buff);
     1235  return(NULL);
     1236}
     1237
    12261238char *owl_command_zaway(int argc, char **argv, char *buff)
    12271239{
     
    16101622  } else {
    16111623    owl_function_zwrite_setup(buff);
    1612     owl_global_set_buffercommand(&g, buff);
    16131624  }
    16141625  return(NULL);
     
    16391650   
    16401651  owl_function_aimwrite_setup(newbuff);
    1641   owl_global_set_buffercommand(&g, newbuff);
    16421652  owl_free(newbuff);
    16431653  return(NULL);
     
    16611671  } else {
    16621672    owl_function_zwrite_setup(buff);
    1663     owl_global_set_buffercommand(&g, buff);
    16641673  }
    16651674  return(NULL);
     
    20952104  int ret;
    20962105 
    2097   if (argc!=3) {
     2106  if ((argc<2) || (argc>3)) {
    20982107    owl_function_makemsg("Wrong number of arguments to aimlogin command");
     2108    return(NULL);
     2109  }
     2110
     2111  /* if we get two arguments, ask for the password */
     2112  if (argc==2) {
     2113    owl_global_set_buffercommand(&g, buff);
     2114    owl_function_start_password("Password: ");
    20992115    return(NULL);
    21002116  }
     
    22302246  owl_global_set_needrefresh(&g);
    22312247
    2232   owl_function_makemsg("Thank you");
     2248  owl_function_run_buffercommand();
    22332249}
    22342250
  • functions.c

    rcf83b7a r453bd70  
    222222  /* make it active */
    223223  owl_global_set_typwin_active(&g);
     224
     225  owl_global_set_buffercommand(&g, line);
    224226}
    225227
     
    250252  /* make it active */
    251253  owl_global_set_typwin_active(&g);
     254
     255  owl_global_set_buffercommand(&g, line);
    252256}
    253257
     
    300304  /* make it active */
    301305  owl_global_set_typwin_active(&g);
     306
     307  owl_global_set_buffercommand(&g, line);
    302308}
    303309
     
    10781084void owl_function_run_buffercommand()
    10791085{
    1080   char *buff;
     1086  char *buff, *ptr;
     1087
     1088  owl_function_debugmsg("Got: %s", buff);
    10811089
    10821090  buff=owl_global_get_buffercommand(&g);
     
    10851093  } else if (!strncmp(buff, "aimwrite ", 9)) {
    10861094    owl_function_aimwrite(buff+9);
     1095  } else if (!strncmp(buff, "aimlogin ", 9)) {
     1096    ptr=owl_sprintf("%s %s", buff, owl_global_get_response(&g));
     1097    owl_function_command(ptr);
     1098    owl_free(ptr);
    10871099  }
    10881100}
     
    19451957}
    19461958
     1959void owl_function_start_password(char *line)
     1960{
     1961  owl_editwin *tw;
     1962
     1963  tw=owl_global_get_typwin(&g);
     1964  owl_global_set_typwin_active(&g);
     1965  owl_editwin_new_style(tw, OWL_EDITWIN_STYLE_ONELINE, owl_global_get_cmd_history(&g));
     1966  owl_editwin_set_echochar(tw, '*');
     1967
     1968  owl_editwin_set_locktext(tw, line);
     1969  owl_global_set_needrefresh(&g);
     1970
     1971  owl_editwin_redisplay(tw, 0);
     1972
     1973  owl_context_set_editresponse(owl_global_get_context(&g), tw);
     1974  owl_function_activate_keymap("editresponse");
     1975}
     1976
    19471977char *owl_function_exec(int argc, char **argv, char *buff, int type)
    19481978{
Note: See TracChangeset for help on using the changeset viewer.