From aad78d378231d1a8a3c44ffda2ada5e63560a58a Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Thu, 27 Aug 2009 18:29:51 +0100 Subject: [PATCH] When not connected don't apply !offline states but save them When we're not connected to a network don't allow setting the status to anything else then offline, but when a status is set do save it so it can be applied as soon as soon as we get network connectivity --- libempathy/empathy-idle.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c index c86b997a..b8c7784d 100644 --- a/libempathy/empathy-idle.c +++ b/libempathy/empathy-idle.c @@ -570,17 +570,19 @@ empathy_idle_set_presence (EmpathyIdle *idle, status = NULL; } - if (!empathy_connectivity_is_online (priv->connectivity)) { + if (state != TP_CONNECTION_PRESENCE_TYPE_OFFLINE && + !empathy_connectivity_is_online (priv->connectivity)) { DEBUG ("Empathy is not online"); + priv->saved_state = state; if (tp_strdiff (priv->status, status)) { - g_free (priv->status); - priv->status = NULL; + g_free (priv->saved_status); + priv->saved_status = NULL; if (!EMP_STR_EMPTY (status)) { - priv->status = g_strdup (status); + priv->saved_status = g_strdup (status); } - g_object_notify (G_OBJECT (idle), "status"); } + return; } empathy_idle_do_set_presence (idle, state, status); -- 2.39.2