From 71c849737edc440b6f98f4d61a428ab7b0673e70 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 14 Dec 2009 12:27:35 +0000 Subject: tp-contact-list: add members of 'stored' as members This allow us to display contacts with subscriptio='none' (#539765). --- libempathy/empathy-tp-contact-list.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 8cc1edcf9..302860924 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -53,6 +53,7 @@ typedef struct { * - members of 'subscribe': we receive their presence * - RP of 'subscribe': we asked to receive their presence * - members of 'publish': we send them our presence + * - members of 'stored': they are in our roster */ GHashTable *members; /* contact handle (TpHandle) => reffed (EmpathyContact *) @@ -680,6 +681,26 @@ tp_contact_list_subscribe_group_members_changed_cb (TpChannel *channel, g_array_free (accept, TRUE); } +static void +tp_contact_list_store_group_members_changed_cb (TpChannel *channel, + gchar *message, + GArray *added, + GArray *removed, + GArray *local_pending, + GArray *remote_pending, + guint actor, + guint reason, + EmpathyTpContactList *list) +{ + guint i; + + add_to_members (list, added); + + for (i = 0; i < removed->len; i++) { + remove_from_member_if_needed (list, g_array_index (removed, TpHandle, i)); + } +} + static void tp_contact_list_new_channel_cb (TpConnection *proxy, const gchar *object_path, @@ -798,6 +819,9 @@ got_list_channel (EmpathyTpContactList *list, if (priv->stored != NULL) return; priv->stored = g_object_ref (channel); + g_signal_connect (priv->stored, "group-members-changed", + G_CALLBACK (tp_contact_list_store_group_members_changed_cb), + list); } else if (!tp_strdiff (id, "publish")) { if (priv->publish != NULL) return; -- cgit v1.2.3