changeset 16768:52342adf4303

Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 02 May 2007 03:22:11 +0000
parents 9a2ec0a033b5
children 588968d4b2c1
files ChangeLog.API libpurple/blist.c libpurple/blist.h
diffstat 3 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Wed May 02 00:56:11 2007 +0000
+++ b/ChangeLog.API	Wed May 02 03:22:11 2007 +0000
@@ -390,6 +390,7 @@
 	* GtkGaimScrollBook and its functions.
 	* purple_markup_unescape_entity()
 	* purple_markup_get_css_property()
+	* purple_group_get_name()
 
 	Signals - Changed:  (See the Doxygen docs for details on all signals.)
 	* Signal propagation now stops after a handler returns a non-NULL value.
--- a/libpurple/blist.c	Wed May 02 00:56:11 2007 +0000
+++ b/libpurple/blist.c	Wed May 02 03:22:11 2007 +0000
@@ -2042,6 +2042,8 @@
 
 	if ((chat->alias != NULL) && (*chat->alias != '\0'))
 		return chat->alias;
+	if (chat->account->gc == NULL)
+		return NULL;
 
 	parts = PURPLE_PLUGIN_PROTOCOL_INFO(chat->account->gc->prpl)->chat_info(chat->account->gc);
 	pce = parts->data;
@@ -2406,6 +2408,13 @@
 	return FALSE;
 }
 
+const char *purple_group_get_name(PurpleGroup *group)
+{
+	g_return_val_if_fail(group != NULL, NULL);
+
+	return group->name;
+}
+
 void
 purple_blist_request_add_buddy(PurpleAccount *account, const char *username,
 							 const char *group, const char *alias)
--- a/libpurple/blist.h	Wed May 02 00:56:11 2007 +0000
+++ b/libpurple/blist.h	Wed May 02 03:22:11 2007 +0000
@@ -686,6 +686,15 @@
 gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account);
 
 /**
+ * Returns the name of a group.
+ *
+ * @param group The group.
+ *
+ * @return The name of the group.
+ */
+const char *purple_group_get_name(PurpleGroup *group);
+
+/**
  * Called when an account gets signed on.  Tells the UI to update all the
  * buddies.
  *