aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-contact-list.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-01-02 06:10:22 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-01-02 06:10:22 +0800
commit5ba8e4047cf01d47781db85b2c400e67b84026a9 (patch)
tree164870ce992ada4185388a2a4f70fb68996f6649 /libempathy/empathy-tp-contact-list.c
parent6fd6f3b1081a5b72054ef135346da0d5eb979590 (diff)
downloadgsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.tar
gsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.tar.gz
gsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.tar.bz2
gsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.tar.lz
gsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.tar.xz
gsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.tar.zst
gsoc2013-empathy-5ba8e4047cf01d47781db85b2c400e67b84026a9.zip
Add a remove option to delete a contact group. Fixes bug #459520 (David Turner).
svn path=/trunk/; revision=528
Diffstat (limited to 'libempathy/empathy-tp-contact-list.c')
-rw-r--r--libempathy/empathy-tp-contact-list.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 805150177..2f366ff10 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -981,6 +981,33 @@ tp_contact_list_rename_group (EmpathyContactList *list,
}
static void
+tp_contact_list_remove_group (EmpathyContactList *list,
+ const gchar *group)
+{
+ EmpathyTpGroup *tp_group;
+ GList *members;
+
+ g_return_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list));
+
+ tp_group = tp_contact_list_find_group (EMPATHY_TP_CONTACT_LIST (list),
+ group);
+
+ if (!tp_group) {
+ return;
+ }
+
+ empathy_debug (DEBUG_DOMAIN, "remove group %s", group);
+
+ /* Remove all members of the group */
+ members = empathy_tp_group_get_members (tp_group);
+ empathy_tp_group_remove_members (tp_group, members, "");
+ empathy_tp_group_close (tp_group);
+
+ g_list_foreach (members, (GFunc) g_object_unref, NULL);
+ g_list_free (members);
+}
+
+static void
tp_contact_list_iface_init (EmpathyContactListIface *iface)
{
iface->add = tp_contact_list_add;
@@ -992,5 +1019,6 @@ tp_contact_list_iface_init (EmpathyContactListIface *iface)
iface->add_to_group = tp_contact_list_add_to_group;
iface->remove_from_group = tp_contact_list_remove_from_group;
iface->rename_group = tp_contact_list_rename_group;
+ iface->remove_group = tp_contact_list_remove_group;
}