aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-14 20:27:35 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-31 16:39:41 +0800
commit71c849737edc440b6f98f4d61a428ab7b0673e70 (patch)
tree7aa0fd684918f3372a4ef04ef8d1338ac28f7826 /libempathy
parentf898afc1d4e7bfae0ee8e3c5e6b7a0a0427fd6e3 (diff)
downloadgsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.tar
gsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.tar.gz
gsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.tar.bz2
gsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.tar.lz
gsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.tar.xz
gsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.tar.zst
gsoc2013-empathy-71c849737edc440b6f98f4d61a428ab7b0673e70.zip
tp-contact-list: add members of 'stored' as members
This allow us to display contacts with subscriptio='none' (#539765).
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-list.c24
1 files changed, 24 insertions, 0 deletions
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 *)
@@ -681,6 +682,26 @@ tp_contact_list_subscribe_group_members_changed_cb (TpChannel *channel,
}
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,
const gchar *channel_type,
@@ -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;