[empathy/gnome-2-28] idle: work around the case if the session doesn't tell us when we go idle (fixes bug #594619)
- From: Jonny Lamb <jonnylamb src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy/gnome-2-28] idle: work around the case if the session doesn't tell us when we go idle (fixes bug #594619)
- Date: Sat, 17 Oct 2009 15:03:31 +0000 (UTC)
commit 5395bb722fc1cb6dfbe415908e86734f523c6128
Author: Jonny Lamb <jonnylamb gnome org>
Date: Sat Oct 17 15:09:47 2009 +0100
idle: work around the case if the session doesn't tell us when we go idle (fixes bug #594619)
Signed-off-by: Jonny Lamb <jonnylamb gnome org>
libempathy/empathy-idle.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index b8c7784..20efbce 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -215,12 +215,23 @@ idle_session_status_changed_cb (DBusGProxy *gs_proxy,
new_status = priv->status;
}
- DEBUG ("Restoring state to %d, reset status to %s",
- priv->away_saved_state, new_status);
-
- empathy_idle_set_presence (idle,
- priv->away_saved_state,
- new_status);
+ /* Only try and set the presence if the away saved state is not
+ * unset. This is an odd case because it means that the session
+ * didn't notify us of the state change to idle, and as a
+ * result, we couldn't save the current state at that time.
+ */
+ if (priv->away_saved_state != TP_CONNECTION_PRESENCE_TYPE_UNSET) {
+ DEBUG ("Restoring state to %d, reset status to %s",
+ priv->away_saved_state, new_status);
+
+ empathy_idle_set_presence (idle,
+ priv->away_saved_state,
+ new_status);
+ } else {
+ DEBUG ("Away saved state is unset. This means that we "
+ "weren't told when the session went idle. "
+ "As a result, I'm not trying to set presence");
+ }
priv->away_saved_state = TP_CONNECTION_PRESENCE_TYPE_UNSET;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]