diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-07-21 23:54:05 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-07-22 00:28:00 +0800 |
commit | aeb06b95274c6c22501c752b9fb8864af6f1bc29 (patch) | |
tree | 4fd4adacf5eede73c56040a291c42a49c47423bf /libempathy | |
parent | 10b85cf1e8161c7f3392f50dc329c89f3bb87512 (diff) | |
download | gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.tar gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.tar.gz gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.tar.bz2 gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.tar.lz gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.tar.xz gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.tar.zst gsoc2013-empathy-aeb06b95274c6c22501c752b9fb8864af6f1bc29.zip |
Make empathy_account_set_enable call out over d-bus
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-account.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/libempathy/empathy-account.c b/libempathy/empathy-account.c index 5ad3ef464..21ece6f0d 100644 --- a/libempathy/empathy-account.c +++ b/libempathy/empathy-account.c @@ -233,8 +233,14 @@ empathy_account_update (EmpathyAccount *account, GHashTable *properties) g_strdup (tp_asv_get_string (properties, "DisplayName")); if (g_hash_table_lookup (properties, "Enabled") != NULL) - empathy_account_set_enabled (account, - tp_asv_get_boolean (properties, "Enabled", NULL)); + { + gboolean enabled = tp_asv_get_boolean (properties, "Enabled", NULL); + if (priv->enabled != enabled) + { + priv->enabled = enabled; + g_object_notify (G_OBJECT (account), "enabled"); + } + } if (g_hash_table_lookup (properties, "Valid") != NULL) priv->valid = tp_asv_get_boolean (properties, "Valid", NULL); @@ -327,6 +333,9 @@ empathy_account_got_all_cb (TpProxy *proxy, { EmpathyAccount *account = EMPATHY_ACCOUNT (weak_object); + DEBUG ("Got initial set of properties for %s", + empathy_account_get_unique_name (account)); + if (error != NULL) { printf ("Unhappy\n"); @@ -780,12 +789,25 @@ empathy_account_set_enabled (EmpathyAccount *account, gboolean enabled) { EmpathyAccountPriv *priv = GET_PRIV (account); + GValue value = {0, }; if (priv->enabled == enabled) return; - priv->enabled = enabled; - g_object_notify (G_OBJECT (account), "enabled"); + g_value_init (&value, G_TYPE_BOOLEAN); + g_value_set_boolean (&value, enabled); + + tp_cli_dbus_properties_call_set (TP_PROXY (priv->account), + -1, + TP_IFACE_ACCOUNT, + "Enabled", + &value, + NULL, + NULL, + NULL, + NULL); + + g_value_unset (&value); } static void |