Changeset 65ad073 for commands.c


Ignore:
Timestamp:
Jun 4, 2003, 11:14:41 AM (17 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:
ae4cd12
Parents:
6a415e9
Message:
'addbuddy zephyr <user>' and 'delbuddy zephyr <user>' now work.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r6a415e9 r65ad073  
    882882char *owl_command_addbuddy(int argc, char **argv, char *buff)
    883883{
    884   if (!owl_global_is_aimloggedin(&g)) {
    885     owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
    886     return(NULL);
    887   }
    888 
    889884  if (argc!=3) {
    890885    owl_function_makemsg("usage: addbuddy <protocol> <buddyname>");
     
    892887  }
    893888
    894   if (strcasecmp(argv[1], "aim")) {
    895     owl_function_makemsg("addbuddy: currently the only supported protocol is 'aim'");
    896     return(NULL);
    897   }
    898 
    899   owl_aim_addbuddy(argv[2]);
    900   owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     889  if (!strcasecmp(argv[1], "aim")) {
     890    if (!owl_global_is_aimloggedin(&g)) {
     891      owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
     892      return(NULL);
     893    }
     894    owl_aim_addbuddy(argv[2]);
     895    owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     896  } else if (!strcasecmp(argv[1], "zephyr")) {
     897    owl_zephyr_addbuddy(argv[2]);
     898    owl_function_makemsg("%s added as zephyr buddy", argv[2]);
     899  } else {
     900    owl_function_makemsg("addbuddy: currently the only supported protocols are 'zephyr' and 'aim'");
     901  }
    901902
    902903  return(NULL);
     
    905906char *owl_command_delbuddy(int argc, char **argv, char *buff)
    906907{
    907   if (!owl_global_is_aimloggedin(&g)) {
    908     owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
    909     return(NULL);
    910   }
    911 
    912908  if (argc!=3) {
    913909    owl_function_makemsg("usage: delbuddy <protocol> <buddyname>");
     
    915911  }
    916912
    917   if (strcasecmp(argv[1], "aim")) {
    918     owl_function_makemsg("delbuddy: currently the only supported protocol is 'aim'");
    919     return(NULL);
    920   }
    921 
    922   owl_aim_delbuddy(argv[2]);
    923   owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     913  if (!strcasecmp(argv[1], "aim")) {
     914    if (!owl_global_is_aimloggedin(&g)) {
     915      owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
     916      return(NULL);
     917    }
     918    owl_aim_delbuddy(argv[2]);
     919    owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     920  } else if (!strcasecmp(argv[1], "zephyr")) {
     921    owl_zephyr_delbuddy(argv[2]);
     922    owl_function_makemsg("%s deleted as zephyr buddy", argv[2]);
     923  } else {
     924    owl_function_makemsg("delbuddy: currently the only supported protocols are 'zephyr' and 'aim'");
     925  }
     926
    924927
    925928  return(NULL);
Note: See TracChangeset for help on using the changeset viewer.