Changeset eac542b8dbbb0cd226442fbe8494256371810a8a for callback.c
- Timestamp:
- 19/07/09 00:21:28 (3 years ago)
- Children:
- c5606aa8a15998dd28faee8a3141cb8ac83b8d24
- Parents:
- ebf9132bb918ff995e2b561867be329ec3e9a9ee
- git-committer:
- Leo Antunes <leo@…> (19/07/09 00:21:28)
- Files:
-
- 1 modified
-
callback.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
callback.c
rbbdcdb4 reac542b 2 2 awayonlock - plugin to set away status on screensaver activation 3 3 Copyright (C) 2009 Leo Antunes <leo@costela.net> 4 4 5 5 This program is free software; you can redistribute it and/or 6 6 modify it under the terms of the GNU General Public License 7 7 as published by the Free Software Foundation; either version 2 8 8 of the License, or (at your option) any later version. 9 9 10 10 This program is distributed in the hope that it will be useful, 11 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 GNU General Public License for more details. 14 14 15 15 You should have received a copy of the GNU General Public License 16 16 along with this program; if not, write to the Free Software … … 44 44 } 45 45 46 gboolean available_only = purple_prefs_get_bool(AWAYONLOCK_PREF_AVAILABLE_ONLY); 46 47 47 48 PurpleSavedStatus *status_current = purple_savedstatus_get_current(); 48 49 49 if(screensaver_status && (purple_savedstatus_get_type(status_current) != PURPLE_STATUS_OFFLINE && purple_savedstatus_get_type(status_current) != PURPLE_STATUS_INVISIBLE) && ! purple_savedstatus_is_idleaway()) {50 if(screensaver_status && ! purple_savedstatus_is_idleaway() && ((!available_only && purple_savedstatus_get_type(status_current) != PURPLE_STATUS_OFFLINE && purple_savedstatus_get_type(status_current) != PURPLE_STATUS_INVISIBLE) || purple_savedstatus_get_type(status_current) == PURPLE_STATUS_AVAILABLE)) { 50 51 status_saved = status_current; 51 purple_debug(PURPLE_DEBUG_INFO, PACKAGE, N_("setting status as away and storing '%s'\n"), purple_savedstatus_get_title(status_saved));52 purple_debug(PURPLE_DEBUG_INFO, PACKAGE, N_("setting status as '%s' and storing '%s'\n"), purple_savedstatus_get_title(status_idle), purple_savedstatus_get_title(status_saved)); 52 53 purple_savedstatus_activate(status_idle); 53 54 } … … 57 58 status_saved = NULL; 58 59 } 60 else { 61 purple_debug(PURPLE_DEBUG_INFO, PACKAGE, N_("ignoring...\n")); 62 } 59 63 } 60 64