changeset 30491:5b8347284660

merge of '0576c6c542692f13557ba1ab61c00b3320aee2f6' and 'bb163d6f4337c871d963d8a3e0ee05008caec839'
author Paul Aurich <paul@darkrain42.org>
date Mon, 06 Sep 2010 03:47:47 +0000
parents cd7b7fa1a420 (current diff) 0149f914962e (diff)
children d69ddbc0772f
files
diffstat 2 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Sun Sep 05 03:38:28 2010 +0000
+++ b/ChangeLog.API	Mon Sep 06 03:47:47 2010 +0000
@@ -2,6 +2,9 @@
 
 version 2.7.4 (MM/DD/YYYY):
 	Perl:
+		Added:
+		* Purple::BuddyList::Chat::get_components
+
 		Changed:
 		* Purple::BuddyList::Chat::new now works properly.  Thanks
 		  to Rafael in devel@conference.pidgin.im for reporting and
--- a/libpurple/plugins/perl/common/BuddyList.xs	Sun Sep 05 03:38:28 2010 +0000
+++ b/libpurple/plugins/perl/common/BuddyList.xs	Mon Sep 06 03:47:47 2010 +0000
@@ -2,6 +2,13 @@
 #include "module.h"
 #include "../perl-handlers.h"
 
+static void
+chat_components_foreach(gpointer key, gpointer value, gpointer user_data)
+{
+	HV *hv = user_data;
+	hv_store(hv, key, strlen(key), newSVpv(value, 0), 0);
+}
+
 MODULE = Purple::BuddyList  PACKAGE = Purple  PREFIX = purple_
 PROTOTYPES: ENABLE
 
@@ -331,6 +338,19 @@
 purple_chat_get_name(chat)
 	Purple::BuddyList::Chat chat
 
+HV *
+purple_chat_get_components(chat)
+	Purple::BuddyList::Chat chat
+INIT:
+	HV * t_HV;
+	GHashTable * t_GHash;
+CODE:
+	t_GHash = purple_chat_get_components(chat);
+	RETVAL = t_HV = newHV();
+	g_hash_table_foreach(t_GHash, chat_components_foreach, t_HV);
+OUTPUT:
+	RETVAL
+
 Purple::BuddyList::Chat
 purple_chat_new(account, alias, components)
 	Purple::Account account