Mercurial > pidgin
diff src/savedstatuses.c @ 12857:e5f780a6137b
[gaim-migrate @ 15208]
This is the ability to set a startup status to be used instead of the status when you last exited. The savedstatus stuff was missing from Changelog.API, so I added it.
committer: Tailor Script <tailor@pidgin.im>
| author | Daniel Atallah <daniel.atallah@gmail.com> |
|---|---|
| date | Fri, 13 Jan 2006 02:47:12 +0000 |
| parents | f88f145884c0 |
| children | e3b9c6c7bcf6 |
line wrap: on
line diff
--- a/src/savedstatuses.c Fri Jan 13 01:02:56 2006 +0000 +++ b/src/savedstatuses.c Fri Jan 13 02:47:12 2006 +0000 @@ -691,6 +691,29 @@ } GaimSavedStatus * +gaim_savedstatus_get_startup() +{ + int creation_time; + GaimSavedStatus *saved_status = NULL; + + creation_time = gaim_prefs_get_int("/core/savedstatus/startup"); + + if (creation_time != 0) + saved_status = g_hash_table_lookup(creation_times, &creation_time); + + if (saved_status == NULL) + { + /* We don't have a status to apply. + * This may be the first login, or the user wants to + * restore the "current" status */ + saved_status = gaim_savedstatus_get_current(); + } + + return saved_status; +} + + +GaimSavedStatus * gaim_savedstatus_get_current() { int creation_time; @@ -909,6 +932,7 @@ GaimAccount *account; account = node->data; + gaim_savedstatus_activate_for_account(saved_status, account); } @@ -978,6 +1002,8 @@ */ gaim_prefs_add_none("/core/savedstatus"); gaim_prefs_add_int("/core/savedstatus/current", 0); + gaim_prefs_add_int("/core/savedstatus/startup", 0); + gaim_prefs_add_bool("/core/savedstatus/startup_current_status", TRUE); gaim_prefs_add_int("/core/savedstatus/idleaway", 0); load_statuses();
