aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2009-10-17 22:09:47 +0800
committerJonny Lamb <jonny@debian.org>2009-10-17 23:03:33 +0800
commit4480f731fddb58b0fc68072f4096727d912d2261 (patch)
tree46d2593064a7030a910fe778cceb6e3930d05692
parent4e360483d0a8dedc613faee420b8ace496243b05 (diff)
downloadgsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.tar
gsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.tar.gz
gsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.tar.bz2
gsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.tar.lz
gsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.tar.xz
gsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.tar.zst
gsoc2013-empathy-4480f731fddb58b0fc68072f4096727d912d2261.zip
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>
-rw-r--r--libempathy/empathy-idle.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 64ec37001..cc6ca62f4 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;
}