aboutsummaryrefslogtreecommitdiffstats
path: root/ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-08-02 21:48:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-08-03 22:13:29 +0800
commit119351a936be47a235b9fd0d7cce1b73fb8e289e (patch)
treed4f883dbd8be291d7c6bb133bc26924f9775a0aa /ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c
parent44982406d7bc6317a7674d21f830ad50ab4f3810 (diff)
downloadgsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.tar
gsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.tar.gz
gsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.tar.bz2
gsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.tar.lz
gsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.tar.xz
gsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.tar.zst
gsoc2013-empathy-119351a936be47a235b9fd0d7cce1b73fb8e289e.zip
Rely on the empathy factory rather than 're-preparing' the AM
tp_account_manager_prepare_all_async() seems to be a bad idea so, instead, let's just rely the empathy factory and set it as default. This makes the code much more symetric with empathy-accounts and shouldn't prepare that much useless features as we are not going to prepare the contact list anyway.
Diffstat (limited to 'ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c')
-rw-r--r--ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c b/ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c
index 43b86ad96..c15a13a7a 100644
--- a/ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c
+++ b/ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin.c
@@ -22,6 +22,8 @@
#include "empathy-app-plugin.h"
+#include <libempathy/empathy-client-factory.h>
+
#include "empathy-app-plugin-widget.h"
G_DEFINE_TYPE (EmpathyAppPlugin, empathy_app_plugin, AP_TYPE_APPLICATION_PLUGIN)
@@ -60,6 +62,19 @@ empathy_app_plugin_class_init (EmpathyAppPluginClass *klass)
static void
empathy_app_plugin_init (EmpathyAppPlugin *self)
{
+ if (tp_account_manager_can_set_default ())
+ {
+ EmpathyClientFactory *factory;
+ TpAccountManager *am;
+
+ factory = empathy_client_factory_dup ();
+ am = tp_account_manager_new_with_factory (
+ TP_SIMPLE_CLIENT_FACTORY (factory));
+ tp_account_manager_set_default (am);
+
+ g_object_unref (factory);
+ g_object_unref (am);
+ }
}
GType