aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorDavyd Madeley <davyd@madeley.id.au>2009-02-11 04:52:36 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-02-11 04:52:36 +0800
commit1cfcab42033de14bfd286a54dbc6d224e534ad27 (patch)
treedd4be666c0adadc0faa0e8c7d5fbab42eb3e22c0 /libempathy
parentc0be726e4bd1c2c85ee0cf9a7e4c06d08155f767 (diff)
downloadgsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.tar
gsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.tar.gz
gsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.tar.bz2
gsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.tar.lz
gsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.tar.xz
gsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.tar.zst
gsoc2013-empathy-1cfcab42033de14bfd286a54dbc6d224e534ad27.zip
Save status message on NetworkManager disconnect and restore on reconnect
From: Davyd Madeley <davyd@madeley.id.au> svn path=/trunk/; revision=2432
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-idle.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index f9dd4fca8..178134738 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -53,6 +53,7 @@ typedef struct {
McPresence away_saved_state;
McPresence nm_saved_state;
+ gchar *nm_saved_status;
gboolean is_idle;
gboolean nm_connected;
@@ -242,15 +243,23 @@ idle_nm_state_change_cb (DBusGProxy *proxy,
if (old_nm_connected && !new_nm_connected) {
/* We are no more connected */
- DEBUG ("Disconnected: Save state %d", priv->state);
+ DEBUG ("Disconnected: Save state %d (%s)",
+ priv->state, priv->status);
priv->nm_saved_state = priv->state;
+ g_free (priv->nm_saved_status);
+ priv->nm_saved_status = g_strdup (priv->status);
empathy_idle_set_state (idle, MC_PRESENCE_OFFLINE);
}
else if (!old_nm_connected && new_nm_connected) {
/* We are now connected */
- DEBUG ("Reconnected: Restore state %d", priv->nm_saved_state);
- empathy_idle_set_state (idle, priv->nm_saved_state);
+ DEBUG ("Reconnected: Restore state %d (%s)",
+ priv->nm_saved_state, priv->nm_saved_status);
+ empathy_idle_set_presence (idle,
+ priv->nm_saved_state,
+ priv->nm_saved_status);
priv->nm_saved_state = MC_PRESENCE_UNSET;
+ g_free (priv->nm_saved_status);
+ priv->nm_saved_status = NULL;
}
priv->nm_connected = new_nm_connected;