aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-29 23:54:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-29 23:54:01 +0800
commitbbe74c7f743b9210a905c74864a9b5d33ad48a87 (patch)
tree798b5ecedc3e9edb0e856881e84b892506e6ebb5
parenta709d4ca6f8249d18d885feaef4f8f2a50a14427 (diff)
downloadgsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.tar
gsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.tar.gz
gsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.tar.bz2
gsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.tar.lz
gsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.tar.xz
gsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.tar.zst
gsoc2013-empathy-bbe74c7f743b9210a905c74864a9b5d33ad48a87.zip
Revert "WIP"
This reverts commit f1a9c6deaa7f706df73cb4e1195647a2a27177c6. Humm I didn't mean to push that, sorry. :\
-rw-r--r--libempathy/empathy-connection-aggregator.c72
-rw-r--r--libempathy/empathy-connection-aggregator.h3
-rw-r--r--src/empathy-event-manager.c34
-rw-r--r--src/empathy.c1
4 files changed, 4 insertions, 106 deletions
diff --git a/libempathy/empathy-connection-aggregator.c b/libempathy/empathy-connection-aggregator.c
index 525320306..043aa4f38 100644
--- a/libempathy/empathy-connection-aggregator.c
+++ b/libempathy/empathy-connection-aggregator.c
@@ -34,13 +34,6 @@
G_DEFINE_TYPE (EmpathyConnectionAggregator, empathy_connection_aggregator,
G_TYPE_OBJECT);
-enum {
- EVENT_CONTACT_LIST_CHANGED,
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL];
-
struct _EmpathyConnectionAggregatorPriv {
TpAccountManager *mgr;
@@ -69,30 +62,10 @@ empathy_connection_aggregator_class_init (
oclass->dispose = empathy_connection_aggregator_dispose;
- signals[EVENT_CONTACT_LIST_CHANGED] =
- g_signal_new ("contact-list-changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL,
- g_cclosure_marshal_generic,
- G_TYPE_NONE,
- 3, TP_TYPE_CONNECTION, G_TYPE_PTR_ARRAY, G_TYPE_PTR_ARRAY);
-
g_type_class_add_private (klass, sizeof (EmpathyConnectionAggregatorPriv));
}
static void
-contact_list_changed_cb (TpConnection *conn,
- GPtrArray *added,
- GPtrArray *removed,
- EmpathyConnectionAggregator *self)
-{
- g_signal_emit (self, signals[EVENT_CONTACT_LIST_CHANGED], 0, conn,
- added, removed);
-}
-
-static void
conn_invalidated_cb (TpConnection *conn,
guint domain,
gint code,
@@ -108,28 +81,12 @@ static void
check_connection (EmpathyConnectionAggregator *self,
TpConnection *conn)
{
- GPtrArray *contacts;
-
if (g_list_find (self->priv->conns, conn) != NULL)
return;
self->priv->conns = g_list_prepend (self->priv->conns,
g_object_ref (conn));
- tp_g_signal_connect_object (conn, "contact-list-changed",
- G_CALLBACK (contact_list_changed_cb), self, 0);
-
- contacts = tp_connection_dup_contact_list (conn);
- if (contacts != NULL)
- {
- GPtrArray *empty;
-
- empty = g_ptr_array_new ();
-
- contact_list_changed_cb (conn, contacts, empty, self);
- g_ptr_array_unref (empty);
- }
-
tp_g_signal_connect_object (conn, "invalidated",
G_CALLBACK (conn_invalidated_cb), self, 0);
}
@@ -259,32 +216,3 @@ empathy_connection_aggregator_get_all_groups (EmpathyConnectionAggregator *self)
return keys;
}
-
-GPtrArray *
-empathy_connection_aggregator_dup_all_contacts (
- EmpathyConnectionAggregator *self)
-{
- GPtrArray *result;
- GList *l;
-
- result = g_ptr_array_new_with_free_func (g_object_unref);
-
- for (l = self->priv->conns; l != NULL; l = g_list_next (l))
- {
- TpConnection *conn = l->data;
- GPtrArray *contacts;
-
- contacts = tp_connection_dup_contact_list (conn);
- if (contacts == NULL)
- continue;
-
- tp_g_ptr_array_extend (result, contacts);
-
- /* tp_g_ptr_array_extend() doesn't give us an extra ref */
- g_ptr_array_foreach (contacts, (GFunc) g_object_ref, NULL);
-
- g_ptr_array_unref (contacts);
- }
-
- return result;
-}
diff --git a/libempathy/empathy-connection-aggregator.h b/libempathy/empathy-connection-aggregator.h
index c21c04dec..6a7fb656e 100644
--- a/libempathy/empathy-connection-aggregator.h
+++ b/libempathy/empathy-connection-aggregator.h
@@ -64,9 +64,6 @@ EmpathyConnectionAggregator * empathy_connection_aggregator_dup_singleton (void)
GList * empathy_connection_aggregator_get_all_groups (
EmpathyConnectionAggregator *self);
-GPtrArray * empathy_connection_aggregator_dup_all_contacts (
- EmpathyConnectionAggregator *self);
-
G_END_DECLS
#endif /* #ifndef __EMPATHY_CONNECTION_AGGREGATOR_H__*/
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index b0c17e71d..c42b82821 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -33,7 +33,7 @@
#include <libempathy/empathy-presence-manager.h>
#include <libempathy/empathy-tp-contact-factory.h>
-#include <libempathy/empathy-connection-aggregator.h>
+#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-tp-chat.h>
#include <libempathy/empathy-tp-streamed-media.h>
#include <libempathy/empathy-utils.h>
@@ -80,7 +80,7 @@ typedef struct {
typedef struct {
TpBaseClient *approver;
TpBaseClient *auth_approver;
- EmpathyConnectionAggregator *conn_aggregator;
+ EmpathyContactManager *contact_manager;
GSList *events;
/* Ongoing approvals */
GSList *approvals;
@@ -1169,7 +1169,6 @@ out:
tp_add_dispatch_operation_context_accept (context);
}
-#if 0
static void
event_pending_subscribe_func (EventPriv *event)
{
@@ -1305,7 +1304,6 @@ event_manager_members_changed_cb (EmpathyContactList *list,
g_signal_handlers_disconnect_by_func (contact,
event_manager_presence_changed_cb, manager);
}
-#endif
static GObject *
event_manager_constructor (GType type,
@@ -1339,7 +1337,7 @@ event_manager_finalize (GObject *object)
g_slist_free (priv->events);
g_slist_foreach (priv->approvals, (GFunc) event_manager_approval_free, NULL);
g_slist_free (priv->approvals);
- g_object_unref (priv->conn_aggregator);
+ g_object_unref (priv->contact_manager);
g_object_unref (priv->approver);
g_object_unref (priv->auth_approver);
g_object_unref (priv->gsettings_notif);
@@ -1387,23 +1385,12 @@ empathy_event_manager_class_init (EmpathyEventManagerClass *klass)
}
static void
-contact_list_changed_cb (EmpathyConnectionAggregator *aggregator,
- TpConnection *conn,
- GPtrArray *added,
- GPtrArray *removed,
- EmpathyEventManager *self)
-{
- g_print ("%u added; %u removed on %s\n", added->len, removed->len, tp_proxy_get_object_path (conn));
-}
-
-static void
empathy_event_manager_init (EmpathyEventManager *manager)
{
EmpathyEventManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
EMPATHY_TYPE_EVENT_MANAGER, EmpathyEventManagerPriv);
GError *error = NULL;
TpAccountManager *am;
- GPtrArray *contacts;
manager->priv = priv;
@@ -1412,25 +1399,12 @@ empathy_event_manager_init (EmpathyEventManager *manager)
priv->sound_mgr = empathy_sound_manager_dup_singleton ();
- priv->conn_aggregator = empathy_connection_aggregator_dup_singleton ();
-
- tp_g_signal_connect_object (priv->conn_aggregator, "contact-list-changed",
- G_CALLBACK (contact_list_changed_cb), manager, 0);
-
-#if 0
+ priv->contact_manager = empathy_contact_manager_dup_singleton ();
g_signal_connect (priv->contact_manager, "pendings-changed",
G_CALLBACK (event_manager_pendings_changed_cb), manager);
g_signal_connect (priv->contact_manager, "members-changed",
G_CALLBACK (event_manager_members_changed_cb), manager);
-#endif
-
- contacts = empathy_connection_aggregator_dup_all_contacts (
- priv->conn_aggregator);
-
- g_print ("XXXXXXXXXXXXXXXx %d contacts\n", contacts->len);
-
- g_ptr_array_unref (contacts);
am = tp_account_manager_dup ();
diff --git a/src/empathy.c b/src/empathy.c
index 6e8a3327e..57f5c8418 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -832,7 +832,6 @@ add_empathy_features (void)
/* empathy_connection_aggregator_get_all_groups(), used by
* EmpathyGroupsWidget relies on it */
TP_CONNECTION_FEATURE_CONTACT_GROUPS,
- TP_CONNECTION_FEATURE_CONTACT_LIST,
NULL);
g_object_unref (factory);