summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-05-20 13:59:23 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-05-21 12:17:24 +0100
commita019177e2ed7f760eec1e2bca07006904df80cba (patch)
tree1d35690b6696da44c8a4c988da6607226ac0e16d
parent99dc669ce69d99d71184f751a195dc91946cc316 (diff)
contactlist example: when removing people from stored, also remove from other lists
-rw-r--r--examples/cm/contactlist/contact-list-manager.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/cm/contactlist/contact-list-manager.c b/examples/cm/contactlist/contact-list-manager.c
index 57752144..5071da96 100644
--- a/examples/cm/contactlist/contact-list-manager.c
+++ b/examples/cm/contactlist/contact-list-manager.c
@@ -1481,7 +1481,9 @@ example_contact_list_manager_remove_from_list (ExampleContactListManager *self,
case EXAMPLE_CONTACT_LIST_STORED:
/* we would like to remove member from the roster altogether */
{
- if (lookup_contact (self, member) != NULL)
+ ExampleContactDetails *d = lookup_contact (self, member);
+
+ if (d != NULL)
{
g_hash_table_remove (self->priv->contact_details,
GUINT_TO_POINTER (member));
@@ -1492,6 +1494,16 @@ example_contact_list_manager_remove_from_list (ExampleContactListManager *self,
NULL, set, NULL, NULL,
self->priv->conn->self_handle,
TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
+ tp_group_mixin_change_members (
+ (GObject *) self->priv->lists[EXAMPLE_CONTACT_LIST_SUBSCRIBE],
+ "", NULL, set, NULL, NULL,
+ self->priv->conn->self_handle,
+ TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
+ tp_group_mixin_change_members (
+ (GObject *) self->priv->lists[EXAMPLE_CONTACT_LIST_PUBLISH],
+ "", NULL, set, NULL, NULL,
+ self->priv->conn->self_handle,
+ TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
tp_intset_destroy (set);
tp_handle_set_remove (self->priv->contacts, member);
@@ -1500,6 +1512,7 @@ example_contact_list_manager_remove_from_list (ExampleContactListManager *self,
* see their presence, so emit a signal changing it to
* UNKNOWN */
g_signal_emit (self, signals[PRESENCE_UPDATED], 0, member);
+
}
}
return TRUE;