Changeset 4b660cc for commands.c


Ignore:
Timestamp:
Dec 23, 2003, 4:13:43 PM (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:
8b16467
Parents:
c65d81e
Message:
Now have a set of 'aaway' commands and variables just like the
  'zaway' ones (except that changing the 'aaway' variable talks to
  the server)
The new 'away' command does everything for both AIM *and* zephyr.
  There is a known funkiness here, where if you turn one away on,
  and then use 'away' (or 'A') to toggle, you will turn on off and
  the other on.  Just leaving it for now.  Should do better in the
  next patch.
The 'A' key is bound to 'away'
Status bar can now read AWAY, Z-AWAY or A-AWAY.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rc65d81e r4b660cc  
    451451
    452452  OWLCMD_ARGS("zaway", owl_command_zaway, OWL_CTX_INTERACTIVE,
    453               "running a command from the shell",
     453              "Set, enable or disable zephyr away message",
    454454              "zaway [ on | off | toggle ]\n"
    455455              "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"),
    459480
    460481  OWLCMD_ARGS("load-subs", owl_command_loadsubs, OWL_CTX_ANY,
     
    13431364}
    13441365
     1366
     1367char *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
     1393char *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}
    13451399
    13461400char *owl_command_set(int argc, char **argv, char *buff)
Note: See TracChangeset for help on using the changeset viewer.