Changeset 4b660cc for variable.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
  • variable.c

    r5a95b69 r4b660cc  
    208208                 OWL_DEFAULT_ZAWAYMSG,
    209209                 "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", "" ),
    210223
    211224  OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all",
     
    355368
    356369/* debug (cache value in g->debug) */
    357 
    358370int owl_variable_debug_set(owl_variable *v, void *newval) {
    359371  if (newval && (*(int*)newval == 1 || *(int*)newval == 0)) {
    360372    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 */
     378int 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    }
    361385  }
    362386  return owl_variable_bool_set_default(v, newval);
Note: See TracChangeset for help on using the changeset viewer.