Changeset 4b660cc
- Timestamp:
- Dec 23, 2003, 4:13:43 PM (20 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:
- 8b16467
- Parents:
- c65d81e
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rc65d81e r4b660cc 8 8 what most clients seem to do, in that an away reply is sent for 9 9 each message received. Most clients only reply to the first one 10 per away-session. Also, it's completely tied to the zaway 11 functions, it should probably be separated out into aaway 12 functions with a new "away" function that will get everything. 13 Loop detection stuff should work and has been tested, but I'm 14 not completely sure I did this right ... so odd behavior should 15 be reported. 16 New 'away' command, just an alias to zaway for now. 17 'A' key now bound to 'away' command. 18 In status bar "ZAWAY" is now "AWAY" 10 per away-session. 11 Now have a set of 'aaway' commands and variables just like the 12 'zaway' ones (except that changing the 'aaway' variable talks to 13 the server) 14 The new 'away' command does everything for both AIM *and* zephyr. 15 There is a known funkiness here, where if you turn one away on, 16 and then use 'away' (or 'A') to toggle, you will turn on off and 17 the other on. Just leaving it for now. Should do better in the 18 next patch. 19 The 'A' key is bound to 'away' 20 Status bar can now read AWAY, Z-AWAY or A-AWAY. 19 21 20 22 2.1.1-pre-1 -
commands.c
rc65d81e r4b660cc 451 451 452 452 OWLCMD_ARGS("zaway", owl_command_zaway, OWL_CTX_INTERACTIVE, 453 " running a command from the shell",453 "Set, enable or disable zephyr away message", 454 454 "zaway [ on | off | toggle ]\n" 455 455 "zaway <message>", 456 "Turn on or off the default zaway message. If a message is\n" 457 "specified turn on zaway with that message\n"), 458 OWLCMD_ALIAS("away", "zaway"), 456 "Turn on or off a zaway message. If 'message' is\n" 457 "specified turn on zaway with that message, otherwise\n" 458 "use the default.\n"), 459 460 OWLCMD_ARGS("aaway", owl_command_aaway, OWL_CTX_INTERACTIVE, 461 "Set, enable or disable AIM away message", 462 "aaway [ on | off | toggle ]\n" 463 "aaway <message>", 464 "Turn on or off the AIM away message. If 'message' is\n" 465 "specified turn on aaway with that message, otherwise\n" 466 "use the default.\n"), 467 468 OWLCMD_ARGS("away", owl_command_away, OWL_CTX_INTERACTIVE, 469 "Set, enable or disable both AIM and zephyr away messages", 470 "away [ on | off | toggle ]\n" 471 "away <message>", 472 "Turn on or off the AIM and zephyr away message. If\n" 473 "'message' is specified turn them on with that message,\n" 474 "otherwise use the default.\n" 475 "\n" 476 "This command really just runs the 'aaway' and 'zaway'\n" 477 "commands together\n" 478 "\n" 479 "SEE ALSO: aaway, zaway"), 459 480 460 481 OWLCMD_ARGS("load-subs", owl_command_loadsubs, OWL_CTX_ANY, … … 1343 1364 } 1344 1365 1366 1367 char *owl_command_aaway(int argc, char **argv, char *buff) 1368 { 1369 if ((argc==1) || 1370 ((argc==2) && !strcmp(argv[1], "on"))) { 1371 owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g)); 1372 owl_function_aaway_on(); 1373 return NULL; 1374 } 1375 1376 if (argc==2 && !strcmp(argv[1], "off")) { 1377 owl_function_aaway_off(); 1378 return NULL; 1379 } 1380 1381 if (argc==2 && !strcmp(argv[1], "toggle")) { 1382 owl_function_aaway_toggle(); 1383 return NULL; 1384 } 1385 1386 buff = skiptokens(buff, 1); 1387 owl_global_set_aaway_msg(&g, buff); 1388 owl_function_aaway_on(); 1389 return NULL; 1390 } 1391 1392 1393 char *owl_command_away(int argc, char **argv, char *buff) 1394 { 1395 owl_command_zaway(argc, argv, buff); 1396 owl_command_aaway(argc, argv, buff); 1397 return NULL; 1398 } 1345 1399 1346 1400 char *owl_command_set(int argc, char **argv, char *buff) -
functions.c
r9854278 r4b660cc 863 863 { 864 864 owl_global_set_zaway_on(&g); 865 owl_aim_set_awaymsg(owl_global_get_zaway_msg(&g)); 866 owl_function_makemsg("aim and zaway set (%s)", owl_global_get_zaway_msg(&g)); 865 owl_function_makemsg("zaway set (%s)", owl_global_get_zaway_msg(&g)); 867 866 } 868 867 … … 870 869 { 871 870 owl_global_set_zaway_off(&g); 872 owl_aim_set_awaymsg(""); 873 owl_function_makemsg("aim and zaway off"); 871 owl_function_makemsg("zaway off"); 872 } 873 874 void owl_function_aaway_toggle() 875 { 876 if (!owl_global_is_aaway(&g)) { 877 owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g)); 878 owl_function_aaway_on(); 879 } else { 880 owl_function_aaway_off(); 881 } 882 } 883 884 void owl_function_aaway_on() 885 { 886 owl_global_set_aaway_on(&g); 887 /* owl_aim_set_awaymsg(owl_global_get_zaway_msg(&g)); */ 888 owl_function_makemsg("AIM away set (%s)", owl_global_get_aaway_msg(&g)); 889 } 890 891 void owl_function_aaway_off() 892 { 893 owl_global_set_aaway_off(&g); 894 /* owl_aim_set_awaymsg(""); */ 895 owl_function_makemsg("AIM away off"); 874 896 } 875 897 -
owl.h
r952bb256 r4b660cc 138 138 139 139 #define OWL_DEFAULT_ZAWAYMSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n" 140 #define OWL_DEFAULT_AAWAYMSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n" 140 141 141 142 #define OWL_INCLUDE_REG_TESTS 1 /* whether to build in regression tests */ -
util.c
rc65d81e r4b660cc 78 78 } 79 79 80 if (owl_global_is_zaway(&g) ) {80 if (owl_global_is_zaway(&g) || owl_global_is_aaway(&g)) { 81 81 getyx(sepwin, y, x); 82 82 wmove(sepwin, y, x+2); 83 83 wattron(sepwin, A_BOLD); 84 84 wattroff(sepwin, A_REVERSE); 85 waddstr(sepwin, " AWAY "); 85 if (owl_global_is_zaway(&g) && owl_global_is_aaway(&g)) { 86 waddstr(sepwin, " AWAY "); 87 } else if (owl_global_is_zaway(&g)) { 88 waddstr(sepwin, " Z-AWAY "); 89 } else if (owl_global_is_aaway(&g)) { 90 waddstr(sepwin, " A-AWAY "); 91 } 86 92 wattron(sepwin, A_REVERSE); 87 93 wattroff(sepwin, A_BOLD); -
variable.c
r5a95b69 r4b660cc 208 208 OWL_DEFAULT_ZAWAYMSG, 209 209 "default zaway message", "" ), 210 211 OWLVAR_BOOL_FULL( "aaway" /* %OwlVarStub */, 0, 212 "Set AIM away status", 213 "", 214 NULL, owl_variable_aaway_set, NULL), 215 216 OWLVAR_STRING( "aaway_msg" /* %OwlVarStub */, 217 OWL_DEFAULT_AAWAYMSG, 218 "AIM away msg for responding when away", "" ), 219 220 OWLVAR_STRING( "aaway_msg_default" /* %OwlVarStub */, 221 OWL_DEFAULT_AAWAYMSG, 222 "default AIM away message", "" ), 210 223 211 224 OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all", … … 355 368 356 369 /* debug (cache value in g->debug) */ 357 358 370 int owl_variable_debug_set(owl_variable *v, void *newval) { 359 371 if (newval && (*(int*)newval == 1 || *(int*)newval == 0)) { 360 372 g.debug = *(int*)newval; 373 } 374 return owl_variable_bool_set_default(v, newval); 375 } 376 377 /* When 'aaway' is changed, need to notify the AIM server */ 378 int owl_variable_aaway_set(owl_variable *v, void *newval) { 379 if (newval) { 380 if (*(int*)newval == 1) { 381 owl_aim_set_awaymsg(owl_global_get_aaway_msg(&g)); 382 } else if (*(int*)newval == 0) { 383 owl_aim_set_awaymsg(""); 384 } 361 385 } 362 386 return owl_variable_bool_set_default(v, newval);
Note: See TracChangeset
for help on using the changeset viewer.