]> git.0d.be Git - empathy.git/blobdiff - goa-mc-plugin/mcp-account-manager-goa.c
local-xmpp-assistant-widget: increase row-spacing
[empathy.git] / goa-mc-plugin / mcp-account-manager-goa.c
index d81c6081652cd2b037941b67f1b2acb0d757e0c3..fd3942eaf359df2be0f1cb553828cc9b7ac9cbe1 100644 (file)
@@ -23,6 +23,8 @@
  *    Danielle Madeley <danielle.madeley@collabora.co.uk>
  */
 
+#include "config.h"
+
 #include <glib/gi18n.h>
 
 #include <telepathy-glib/util.h>
@@ -40,7 +42,7 @@
 #define PLUGIN_NAME "goa"
 #define PLUGIN_PRIORITY (MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING + 10)
 #define PLUGIN_DESCRIPTION "Provide Telepathy Accounts from GOA"
-#define PLUGIN_PROVIDER "org.gnome.OnlineAccounts"
+#define PLUGIN_PROVIDER EMPATHY_GOA_PROVIDER
 
 #define INITIAL_COMMENT "Parameters of GOA Telepathy accounts"
 
@@ -80,7 +82,7 @@ mcp_account_manager_goa_finalize (GObject *self)
 {
   McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
 
-  g_hash_table_destroy (priv->accounts);
+  g_hash_table_unref (priv->accounts);
   g_key_file_free (priv->store);
   g_free (priv->filename);
 
@@ -125,15 +127,33 @@ get_tp_parameters (GoaAccount *account)
       PARAM ("param-extra-certificate-identities", "talk.google.com");
       PARAM ("param-require-encryption", "true");
     }
+  else if (!tp_strdiff (type, "facebook"))
+    {
+      PARAM ("manager", "gabble");
+      PARAM ("protocol", "jabber");
+      PARAM ("Icon", "im-facebook");
+      PARAM ("Service", "facebook");
+
+      PARAM ("param-account", "chat.facebook.com");
+      PARAM ("param-require-encryption", "true");
+    }
+  else if (!tp_strdiff (type, "windows_live"))
+    {
+      PARAM ("manager", "gabble");
+      PARAM ("protocol", "jabber");
+      PARAM ("Icon", "im-msn");
+      PARAM ("Service", "windows-live");
+
+      PARAM ("param-account", "messenger.live.com");
+      PARAM ("param-require-encryption", "true");
+    }
   else
     {
-      /* unknown account type */
-      g_hash_table_destroy (params);
+      DEBUG ("Unknown account type %s", type);
+      g_hash_table_unref (params);
       return NULL;
     }
 
-  /* TODO: add Facebook support */
-
   /* generic properties */
   PARAM ("DisplayName", goa_account_get_presentation_identity (account));
 
@@ -159,7 +179,7 @@ get_tp_account_name (GoaAccount *account)
       (char *) g_hash_table_lookup (params, "protocol"),
       type, id);
 
-  g_hash_table_destroy (params);
+  g_hash_table_unref (params);
 
   return name;
 }
@@ -379,7 +399,7 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
       while (g_hash_table_iter_next (&iter, &key, &value))
         mcp_account_manager_set_value (am, acct, key, value);
 
-      g_hash_table_destroy (params);
+      g_hash_table_unref (params);
 
       /* Stored properties */
       keys = g_key_file_get_keys (priv->store, acct, &nkeys, NULL);
@@ -419,7 +439,7 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
 
       mcp_account_manager_set_value (am, acct, key, value);
 
-      g_hash_table_destroy (params);
+      g_hash_table_unref (params);
       g_free (value);
     }