From a610fd969c0aa9483ef4d575d65ed989bf114cbc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 14 Dec 2009 11:16:31 +0000 Subject: factor out remove_from_member_if_needed Call it that way because we are about to add some check before removing a contact from members. --- libempathy/empathy-tp-contact-list.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 8d88e00d5..646270ddd 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -497,6 +497,15 @@ tp_contact_list_remove_handle (EmpathyTpContactList *list, } } +static void +remove_from_member_if_needed (EmpathyTpContactList *list, + TpHandle handle) +{ + EmpathyTpContactListPriv *priv = GET_PRIV (list); + + tp_contact_list_remove_handle (list, priv->members, handle); +} + static void tp_contact_list_publish_group_members_changed_cb (TpChannel *channel, gchar *message, @@ -615,8 +624,7 @@ tp_contact_list_subscribe_group_members_changed_cb (TpChannel *channel, /* Those contacts refuse to send us their presence, remove from members. */ for (i = 0; i < removed->len; i++) { - tp_contact_list_remove_handle (list, priv->members, - g_array_index (removed, TpHandle, i)); + remove_from_member_if_needed (list, g_array_index (removed, TpHandle, i)); } /* We want those contacts in our contact list but we don't get their -- cgit v1.2.3