]> git.0d.be Git - empathy.git/commitdiff
No need of a contact factory to set location
authorXavier Claessens <xclaesse@gmail.com>
Thu, 29 Apr 2010 09:44:49 +0000 (11:44 +0200)
committerXavier Claessens <xclaesse@gmail.com>
Sat, 1 May 2010 19:47:54 +0000 (21:47 +0200)
libempathy-gtk/empathy-location-manager.c
libempathy/empathy-tp-contact-factory.c
libempathy/empathy-tp-contact-factory.h

index 0165052e15eeaa3cedf971e628061801ddbf7c38..0a9d4dcf71a73eb66ef5f21e0b87dc81ebf3b0b5 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "libempathy/empathy-enum-types.h"
 #include "libempathy/empathy-location.h"
-#include "libempathy/empathy-tp-contact-factory.h"
 #include "libempathy/empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_LOCATION
@@ -182,6 +181,16 @@ empathy_location_manager_class_init (EmpathyLocationManagerClass *class)
   g_type_class_add_private (object_class, sizeof (EmpathyLocationManagerPriv));
 }
 
+static void
+publish_location_cb (TpConnection *connection,
+                     const GError *error,
+                     gpointer user_data,
+                     GObject *weak_object)
+{
+  if (error != NULL)
+      DEBUG ("Error setting location: %s", error->message);
+}
+
 static void
 publish_location (EmpathyLocationManager *self,
     TpConnection *conn,
@@ -191,7 +200,6 @@ publish_location (EmpathyLocationManager *self,
   guint connection_status = -1;
   gboolean can_publish;
   EmpathyConf *conf = empathy_conf_get ();
-  EmpathyTpContactFactory *factory;
 
   if (!conn)
     return;
@@ -215,9 +223,8 @@ publish_location (EmpathyLocationManager *self,
       (g_hash_table_size (priv->location) == 0 ? "empty" : ""),
       conn);
 
-  factory = empathy_tp_contact_factory_dup_singleton (conn);
-  empathy_tp_contact_factory_set_location (factory, priv->location);
-  g_object_unref (factory);
+  tp_cli_connection_interface_location_call_set_location (conn, -1,
+      priv->location, publish_location_cb, NULL, NULL, G_OBJECT (self));
 }
 
 typedef struct
index bbb3886ae4169576e58b627d73e0ac495bbbbd14..068c62d62f7516ce028a4d40c165c48ee735361a 100644 (file)
@@ -124,17 +124,6 @@ tp_contact_factory_set_aliases_cb (TpConnection *connection,
        }
 }
 
-static void
-tp_contact_factory_set_location_cb (TpConnection *tp_conn,
-                                   const GError *error,
-                                   gpointer user_data,
-                                   GObject *weak_object)
-{
-       if (error != NULL) {
-               DEBUG ("Error setting location: %s", error->message);
-       }
-}
-
 static void
 tp_contact_factory_avatar_retrieved_cb (TpConnection *connection,
                                        guint         handle,
@@ -731,24 +720,6 @@ empathy_tp_contact_factory_set_alias (EmpathyTpContactFactory *tp_factory,
        g_hash_table_destroy (new_alias);
 }
 
-void
-empathy_tp_contact_factory_set_location (EmpathyTpContactFactory *tp_factory,
-                                        GHashTable              *location)
-{
-       EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory);
-
-       g_return_if_fail (EMPATHY_IS_TP_CONTACT_FACTORY (tp_factory));
-
-       DEBUG ("Setting location");
-
-       tp_cli_connection_interface_location_call_set_location (priv->connection,
-                                                                -1,
-                                                                location,
-                                                                tp_contact_factory_set_location_cb,
-                                                                NULL, NULL,
-                                                                G_OBJECT (tp_factory));
-}
-
 static void
 tp_contact_factory_get_property (GObject    *object,
                                 guint       param_id,
index 4cce6ec6aff89b535309aff70e8af739dba3efed..d2572f29807a3a18da7cfec62075bba9cf946226 100644 (file)
@@ -104,8 +104,6 @@ void                     empathy_tp_contact_factory_get_from_handle  (EmpathyTpC
 void                     empathy_tp_contact_factory_set_alias        (EmpathyTpContactFactory *tp_factory,
                                                                      EmpathyContact          *contact,
                                                                      const gchar             *alias);
-void                     empathy_tp_contact_factory_set_location     (EmpathyTpContactFactory *tp_factory,
-                                                                     GHashTable              *location);
 G_END_DECLS
 
 #endif /* __EMPATHY_TP_CONTACT_FACTORY_H__ */