Changeset d09e5a1 for commands.c


Ignore:
Timestamp:
May 31, 2003, 3:33:42 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:
5e53c4a
Parents:
c86a35c
Message:
Added libfaim
Added basic AIM support, including the "aimlogin", "aimwrite" and
   "aimlogout" commands
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    recd5dc5 rd09e5a1  
    111111              "-O opcode\n"
    112112              "      Send to the specified opcode\n"),
     113
     114  OWLCMD_ARGS("aimwrite", owl_command_aimwrite, OWL_CTX_INTERACTIVE,
     115              "send a zephyr",
     116              "aimzwrite <user>",
     117              "Send an aim message to a user.\n"),
    113118
    114119  /*
     
    566571              "is performed backwards"),
    567572
     573  OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY,
     574              "login to an AIM account",
     575              "aimlogin <screenname> <password>\n",
     576              ""),
     577
     578  OWLCMD_ARGS("aimlogout", owl_command_aimlogout, OWL_CTX_ANY,
     579              "logout from AIM",
     580              "aimlogout\n",
     581              ""),
     582
     583
    568584  /****************************************************************/
    569585  /************************* EDIT-SPECIFIC ************************/
     
    12051221    owl_function_xterm_deiconify();
    12061222  } else {
    1207     owl_function_makemsg("Uknown terminal subcommand");
     1223    owl_function_makemsg("Unknown terminal subcommand");
    12081224  }
    12091225  return(NULL);
     
    13531369    tmpbuff = owl_strdup(buff);
    13541370    owl_function_zwrite_setup(tmpbuff);
     1371    owl_global_set_buffercommand(&g, tmpbuff);
     1372    owl_free(tmpbuff);
     1373  }
     1374  return NULL;
     1375}
     1376
     1377char *owl_command_aimwrite(int argc, char **argv, char *buff) {
     1378  char *tmpbuff, *pos, *cmd, *msg;
     1379
     1380  if (argc < 2) {
     1381    owl_function_makemsg("Not enough arguments to the aimwrite command.");
     1382  } else {
     1383    tmpbuff = owl_strdup(buff);
     1384    owl_function_aimwrite_setup(tmpbuff);
    13551385    owl_global_set_buffercommand(&g, tmpbuff);
    13561386    owl_free(tmpbuff);
     
    17401770}
    17411771
     1772char *owl_command_aimlogin(int argc, char **argv, char *buff) {
     1773  int ret;
     1774
     1775  if (argc!=3) {
     1776    owl_function_makemsg("Wrong number of arguments to aimlogin command");
     1777    return(NULL);
     1778  }
     1779  ret=owl_aim_login(argv[1], argv[2]);
     1780  if (!ret) {
     1781    owl_function_makemsg("%s logged in.\n", argv[1]);
     1782    return(NULL);
     1783  }
     1784 
     1785  owl_function_makemsg("Warning: login for %s failed.\n");
     1786  return(NULL);
     1787}
     1788
     1789char *owl_command_aimlogout(int argc, char **argv, char *buff) {
     1790  owl_aim_logout();
     1791  return(NULL);
     1792}
     1793
    17421794/*********************************************************************/
    17431795/************************** EDIT SPECIFIC ****************************/
Note: See TracChangeset for help on using the changeset viewer.