[empathy] factor out remove_from_member_if_needed



commit a610fd969c0aa9483ef4d575d65ed989bf114cbc
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Dec 14 11:16:31 2009 +0000

    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 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 8d88e00..646270d 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -498,6 +498,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,
 						  GArray        *added,
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]