changeset 29729:e26af064fe8c

added purple_contact_get_group
author Gary Kramlich <grim@reaperworld.com>
date Fri, 11 Dec 2009 01:32:16 +0000
parents 31a34388fb1d
children bbd19d235b72
files libpurple/blist.c libpurple/blist.h
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Fri Dec 11 00:55:09 2009 +0000
+++ b/libpurple/blist.c	Fri Dec 11 01:32:16 2009 +0000
@@ -1739,6 +1739,14 @@
 	g_free(contact);
 }
 
+PurpleGroup *
+purple_contact_get_group(const PurpleContact *contact)
+{
+	g_return_val_if_fail(contact, NULL);
+
+	return (PurpleGroup *)(((PurpleBlistNode *)contact)->parent);
+}
+
 void purple_contact_set_alias(PurpleContact *contact, const char *alias)
 {
 	purple_blist_alias_contact(contact,alias);
--- a/libpurple/blist.h	Fri Dec 11 00:55:09 2009 +0000
+++ b/libpurple/blist.h	Fri Dec 11 01:32:16 2009 +0000
@@ -735,6 +735,16 @@
 void purple_contact_destroy(PurpleContact *contact);
 
 /**
+ * Gets the PurpleGroup from a PurpleContact
+ *
+ * @param contact  The contact
+ * @return         The group
+ *
+ * @since 2.7.0
+ */
+PurpleGroup *purple_contact_get_group(const PurpleContact *contact);
+
+/**
  * Adds a new contact to the buddy list.
  *
  * The new contact will be inserted after insert or prepended to the list if