]> git.0d.be Git - empathy.git/commitdiff
empathy-auth-client: use a TpSimpleClientFactory
authorXavier Claessens <xclaesse@gmail.com>
Tue, 4 Oct 2011 11:09:04 +0000 (13:09 +0200)
committerXavier Claessens <xclaesse@gmail.com>
Fri, 4 Nov 2011 09:10:19 +0000 (10:10 +0100)
This prevent TpBaseClient to create a full TpAccountManager and allow
us to prepare TP_ACCOUNT_FEATURE_STORAGE feature on accounts

libempathy/empathy-auth-factory.c
libempathy/empathy-auth-factory.h
src/empathy-auth-client.c

index 6368b1d7d914852506f49e444d351a7810d6d3c3..663dce050650ef3d9f94b0faaba2f48df54c515a 100644 (file)
@@ -565,19 +565,12 @@ empathy_auth_factory_class_init (EmpathyAuthFactoryClass *klass)
 }
 
 EmpathyAuthFactory *
-empathy_auth_factory_dup_singleton (void)
+empathy_auth_factory_new (TpSimpleClientFactory *factory)
 {
-  EmpathyAuthFactory *out = NULL;
-  TpDBusDaemon *bus;
-
-  bus = tp_dbus_daemon_dup (NULL);
-  out = g_object_new (EMPATHY_TYPE_AUTH_FACTORY,
-      "dbus-daemon", bus,
+  return g_object_new (EMPATHY_TYPE_AUTH_FACTORY,
+      "factory", factory,
       "name", "Empathy.Auth",
       NULL);
-  g_object_unref (bus);
-
-  return out;
 }
 
 gboolean
index e9a670ceb2d48a9e3b17f0983d29d3160b7e59d9..e84c13bcc0f358b52511864157cc515d25da465f 100644 (file)
@@ -59,7 +59,7 @@ GType empathy_auth_factory_get_type (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_AUTH_FACTORY, \
     EmpathyAuthFactoryClass))
 
-EmpathyAuthFactory * empathy_auth_factory_dup_singleton (void);
+EmpathyAuthFactory * empathy_auth_factory_new (TpSimpleClientFactory *factory);
 
 gboolean empathy_auth_factory_register (EmpathyAuthFactory *self,
     GError **error);
index b7988e07e39f855ed793eaac6fc4ebfe5c0aab16..bb7446847bfe5e7e4248695e17371f7945d84b81 100644 (file)
@@ -243,6 +243,8 @@ main (int argc,
   GError *error = NULL;
   EmpathyAuthFactory *factory;
   TpDebugSender *debug_sender;
+  TpSimpleClientFactory *tp_factory;
+  TpDBusDaemon *dbus;
 
   g_thread_init (NULL);
 
@@ -276,7 +278,15 @@ main (int argc,
   g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN);
 #endif
 
-  factory = empathy_auth_factory_dup_singleton ();
+  dbus = tp_dbus_daemon_dup (NULL);
+  tp_factory = tp_simple_client_factory_new (dbus);
+  tp_simple_client_factory_add_account_features_varargs (tp_factory,
+      TP_ACCOUNT_FEATURE_STORAGE,
+      0);
+
+  factory = empathy_auth_factory_new (tp_factory);
+  g_object_unref (tp_factory);
+  g_object_unref (dbus);
 
   g_signal_connect (factory, "new-server-tls-handler",
       G_CALLBACK (auth_factory_new_tls_handler_cb), NULL);