]> git.0d.be Git - empathy.git/commitdiff
Check if there is a publish/subscribe list before adding/removing contacts from them...
authorXavier Claessens <xclaesse@src.gnome.org>
Thu, 12 Jun 2008 06:52:25 +0000 (06:52 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Thu, 12 Jun 2008 06:52:25 +0000 (06:52 +0000)
svn path=/trunk/; revision=1160

libempathy/empathy-tp-contact-list.c

index 93f81e8fd7d0974835b04eb1417fc6ff81fa3925..685b13ef47b49ae999002f1667ec772c84e2e3d6 100644 (file)
@@ -843,8 +843,11 @@ tp_contact_list_add (EmpathyContactList *list,
 
        g_return_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list));
 
-       empathy_tp_group_add_member (priv->subscribe, contact, message);
-       if (g_list_find (priv->pendings, contact)) {
+       if (priv->subscribe) {
+               empathy_tp_group_add_member (priv->subscribe, contact, message);
+       }
+
+       if (priv->publish && g_list_find (priv->pendings, contact)) {
                empathy_tp_group_add_member (priv->publish, contact, message);          
        }
 }
@@ -858,8 +861,12 @@ tp_contact_list_remove (EmpathyContactList *list,
 
        g_return_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list));
 
-       empathy_tp_group_remove_member (priv->subscribe, contact, message);
-       empathy_tp_group_remove_member (priv->publish, contact, message);               
+       if (priv->subscribe) {
+               empathy_tp_group_remove_member (priv->subscribe, contact, message);
+       }
+       if (priv->publish) {
+               empathy_tp_group_remove_member (priv->publish, contact, message);               
+       }
 }
 
 static GList *