Changeset fd93b41 for commands.c


Ignore:
Timestamp:
Jun 3, 2003, 5:38:08 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:
38cf544c
Parents:
aa5f725
Message:
Started work on 'addbuddy' and 'delbuddy' command but they DO NOT
  WORK yet
Removed a bit of faim code that allowed commands to be executed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    raa5f725 rfd93b41  
    197197              "dump <filename>",
    198198              "Dump messages in current view to the named file."),
     199
     200  OWLCMD_ARGS("addbuddy", owl_command_addbuddy, OWL_CTX_INTERACTIVE,
     201              "add a buddy to a buddylist",
     202              "addbuddy aim <screenname>",
     203              "Add the named buddy to your buddylist.  Eventually other protocols,"
     204              "such as zephyr, will also be able to use this command.  For now the"
     205              "only available protocol is 'aim', specified as the first argument."),
     206
     207  OWLCMD_ARGS("delbuddy", owl_command_delbuddy, OWL_CTX_INTERACTIVE,
     208              "delete a buddy from a buddylist",
     209              "delbuddy aim <screenname>",
     210              "Delete the named buddy to your buddylist.  Eventually other protocols,"
     211              "such as zephyr, will also be able to use this command.  For now the"
     212              "only available protocol is 'aim', specified as the first argument."),
    199213
    200214  OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE,
     
    851865  sprintf(buff, "Owl version %s", OWL_VERSION_STRING);
    852866  owl_function_makemsg(buff);
     867}
     868
     869char *owl_command_addbuddy(int argc, char **argv, char *buff)
     870{
     871  if (!owl_global_is_aimloggedin(&g)) {
     872    owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
     873    return(NULL);
     874  }
     875
     876  if (argc!=3) {
     877    owl_function_makemsg("usage: addbuddy <protocol> <buddyname>");
     878    return(NULL);
     879  }
     880
     881  if (strcasecmp(argv[1], "aim")) {
     882    owl_function_makemsg("addbuddy: currently the only supported protocol is 'aim'");
     883    return(NULL);
     884  }
     885
     886  owl_aim_addbuddy(argv[2]);
     887  owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     888
     889  return(NULL);
     890}
     891
     892char *owl_command_delbuddy(int argc, char **argv, char *buff)
     893{
     894  if (!owl_global_is_aimloggedin(&g)) {
     895    owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
     896    return(NULL);
     897  }
     898
     899  if (argc!=3) {
     900    owl_function_makemsg("usage: delbuddy <protocol> <buddyname>");
     901    return(NULL);
     902  }
     903
     904  if (strcasecmp(argv[1], "aim")) {
     905    owl_function_makemsg("delbuddy: currently the only supported protocol is 'aim'");
     906    return(NULL);
     907  }
     908
     909  owl_aim_delbuddy(argv[2]);
     910  owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     911
     912  return(NULL);
    853913}
    854914
Note: See TracChangeset for help on using the changeset viewer.