Changeset 8ba37ec for commands.c


Ignore:
Timestamp:
Dec 29, 2003, 2:50:56 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:
5ca5f8e
Parents:
421c286f
Message:
Fixed a bug where sending a null zsig could cause a crash
Better 'away' toggling if only one protocol is away.
Bumped version to 2.1.4
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r32eed98 r8ba37ec  
    13981398char *owl_command_away(int argc, char **argv, char *buff)
    13991399{
    1400   owl_command_zaway(argc, argv, buff);
    1401   owl_command_aaway(argc, argv, buff);
     1400  if ((argc==1) ||
     1401      ((argc==2) && !strcmp(argv[1], "on"))) {
     1402    owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g));
     1403    owl_global_set_zaway_msg(&g, owl_global_get_zaway_msg_default(&g));
     1404    owl_function_aaway_on();
     1405    owl_function_zaway_on();
     1406    owl_function_makemsg("Away messages set.", owl_global_get_aaway_msg_default(&g));
     1407    return NULL;
     1408  }
     1409
     1410  if (argc==2 && !strcmp(argv[1], "off")) {
     1411    owl_function_aaway_off();
     1412    owl_function_zaway_off();
     1413    return NULL;
     1414  }
     1415
     1416  if (argc==2 && !strcmp(argv[1], "toggle")) {
     1417    /* if either one is on, turn it off, otherwise toggle both (turn
     1418     *  them both on)
     1419     */
     1420    if (!owl_global_is_zaway(&g) && !owl_global_is_aaway(&g)) {
     1421      owl_function_aaway_toggle();
     1422      owl_function_zaway_toggle();
     1423      owl_function_makemsg("Away messages set.");
     1424    } else {
     1425      if (owl_global_is_zaway(&g)) owl_function_zaway_toggle();
     1426      if (owl_global_is_aaway(&g)) owl_function_aaway_toggle();
     1427      owl_function_makemsg("Away messages off.");
     1428    }
     1429    return NULL;
     1430  }
     1431
     1432  buff = skiptokens(buff, 1);
     1433  owl_global_set_aaway_msg(&g, buff);
     1434  owl_global_set_zaway_msg(&g, buff);
     1435  owl_function_aaway_on();
     1436  owl_function_zaway_on();
     1437  owl_function_makemsg("Away messages set.");
    14021438  return NULL;
    14031439}
Note: See TracChangeset for help on using the changeset viewer.