Show
Ignore:
Timestamp:
11/01/09 20:26:43 (2 years ago)
Author:
Leo Antunes <leo@…>
Children:
1aef8415e1cd98c88d3980e0d949c832c3ddd7e8
Parents:
e3cc7b23a6aba21796577ff44a9a3f9d855080cb
git-committer:
Leo Antunes <leo@…> (11/01/09 20:26:43)
Message:

- store changed status as pref and restore at startup if it exists:

avoid awayonlock messing with the last-online status if you quit
while idle.

- minor tweaks and fixes to the test script

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • awayonlock.c

    re3cc7b2 rd1a41d2  
    5656        purple_debug(PURPLE_DEBUG_INFO, PACKAGE, N_("plugin_load called\n")); 
    5757 
     58        if(purple_prefs_get_int(AWAYONLOCK_PREF_OLD_STATUS) != 0) { 
     59                PurpleSavedStatus *status_saved = purple_savedstatus_find_by_creation_time((time_t)purple_prefs_get_int(AWAYONLOCK_PREF_OLD_STATUS)); 
     60                purple_debug(PURPLE_DEBUG_INFO, PACKAGE, N_("stale status '%s' located, restoring and clearing\n"), purple_savedstatus_get_title(status_saved)); 
     61                purple_savedstatus_activate(status_saved); 
     62                purple_prefs_set_int(AWAYONLOCK_PREF_OLD_STATUS, 0); 
     63        } 
     64 
    5865        dbus_conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error); 
    5966 
     
    195202        purple_prefs_add_none(AWAYONLOCK_PREF_ROOT); 
    196203        purple_prefs_add_string(AWAYONLOCK_PREF_STATUS, NULL); 
     204        purple_prefs_add_int(AWAYONLOCK_PREF_OLD_STATUS, 0); 
    197205        purple_prefs_add_bool(AWAYONLOCK_PREF_AVAILABLE_ONLY, 0); 
    198206}