]> git.0d.be Git - empathy.git/commitdiff
GOA plugin: only save parameters from GOA accounts
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 13 Sep 2011 10:17:50 +0000 (12:17 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 14 Sep 2011 08:00:00 +0000 (10:00 +0200)
We should let MC deal with normal accounts.

https://bugzilla.gnome.org/show_bug.cgi?id=658895

goa-mc-plugin/mcp-account-manager-goa.c

index a1fe9f8e1d9f7561882e550815622c79df6aea2c..5c6cd38968094fdfc57bf5c7237dbdebbfb99773 100644 (file)
@@ -427,6 +427,14 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
   return TRUE;
 }
 
+static gboolean
+account_is_in_goa (const McpAccountStorage *self,
+    const gchar *account)
+{
+  McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
+
+  return (g_hash_table_lookup (priv->accounts, acct) != NULL);
+}
 
 static gboolean
 mcp_account_manager_goa_set (const McpAccountStorage *self,
@@ -438,6 +446,9 @@ mcp_account_manager_goa_set (const McpAccountStorage *self,
   McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
   GError *error = NULL;
 
+  if (!account_is_in_goa (self, account))
+    return FALSE;
+
   /* No need to save Enabled, it's up to the GOA configuration if the account
    * is configured or not. */
   if (!tp_strdiff (key, "Enabled"))
@@ -463,6 +474,9 @@ mcp_account_manager_goa_delete (const McpAccountStorage *self,
 {
   McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
 
+  if (!account_is_in_goa (self, account))
+    return FALSE;
+
   DEBUG ("%s: (%s, %s)", G_STRFUNC, account, key);
 
   if (key == NULL)