Changeset 65ad073 for commands.c
- Timestamp:
- Jun 4, 2003, 11:14:41 AM (21 years ago)
- 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:
- ae4cd12
- Parents:
- 6a415e9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r6a415e9 r65ad073 882 882 char *owl_command_addbuddy(int argc, char **argv, char *buff) 883 883 { 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 889 884 if (argc!=3) { 890 885 owl_function_makemsg("usage: addbuddy <protocol> <buddyname>"); … … 892 887 } 893 888 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 } 901 902 902 903 return(NULL); … … 905 906 char *owl_command_delbuddy(int argc, char **argv, char *buff) 906 907 { 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 912 908 if (argc!=3) { 913 909 owl_function_makemsg("usage: delbuddy <protocol> <buddyname>"); … … 915 911 } 916 912 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 924 927 925 928 return(NULL);
Note: See TracChangeset
for help on using the changeset viewer.