Mercurial > pidgin
diff libpurple/idle.c @ 18050:2f9eabdc6011
propagate from branch 'im.pidgin.pidgin' (head dcdd8dc5d40cafef802a88f3f713ee1589bc9c41)
to branch 'im.pidgin.pidgin.2.1.0' (head b13966c1f1b76ef136a61969fc8bcc68f02b138c)
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 06 Jun 2007 00:23:41 +0000 |
parents | 678d78b7fa34 ac504f643092 |
children | 4ca97b26a8fb |
line wrap: on
line diff
--- a/libpurple/idle.c Tue Jun 05 12:14:38 2007 +0000 +++ b/libpurple/idle.c Wed Jun 06 00:23:41 2007 +0000 @@ -92,7 +92,7 @@ } -static int no_away = 0; +static gboolean no_away = FALSE; static gint time_until_next_idle_event; /* * This function should be called when you think your idle state @@ -118,15 +118,15 @@ time_t time_idle; gboolean auto_away; const gchar *idle_reporting; - gboolean report_idle; - GList *l; + gboolean report_idle = TRUE; gint away_seconds = 0; gint idle_recheck_interval = 0; purple_signal_emit(purple_blist_get_handle(), "update-idle"); idle_reporting = purple_prefs_get_string("/purple/away/idle_reporting"); - report_idle = TRUE; + auto_away = purple_prefs_get_bool("/purple/away/away_when_idle"); + if (!strcmp(idle_reporting, "system") && (idle_ui_ops != NULL) && (idle_ui_ops->get_time_idle != NULL)) { @@ -145,15 +145,9 @@ /* Don't report idle time */ time_idle = 0; report_idle = FALSE; - } - /* Auto-away stuff */ - auto_away = purple_prefs_get_bool("/purple/away/away_when_idle"); - - /* If we're not reporting idle, we can still do auto-away. - * First try "system" and if that isn't possible, use "purple" */ - if (!report_idle) - { + /* If we're not reporting idle, we can still do auto-away. + * First try "system" and if that isn't possible, use "purple" */ if (auto_away) { if ((idle_ui_ops != NULL) && (idle_ui_ops->get_time_idle != NULL)) @@ -172,7 +166,7 @@ if (!no_away) { purple_savedstatus_set_idleaway(FALSE); - no_away = 1; + no_away = TRUE; } time_until_next_idle_event = 0; return; @@ -192,11 +186,11 @@ if (auto_away && time_idle > away_seconds) { purple_savedstatus_set_idleaway(TRUE); - no_away = 0; + no_away = FALSE; } else if (!no_away && time_idle < away_seconds) { - no_away = 1; + no_away = TRUE; purple_savedstatus_set_idleaway(FALSE); if (time_until_next_idle_event == 0 || (away_seconds - time_idle) < time_until_next_idle_event) time_until_next_idle_event = away_seconds - time_idle; @@ -205,6 +199,7 @@ /* Idle reporting stuff */ if (report_idle && (time_idle >= IDLEMARK)) { + GList *l; for (l = purple_connections_get_all(); l != NULL; l = l->next) { PurpleConnection *gc = l->data;