# HG changeset patch # User Paul Aurich # Date 1283744784 0 # Node ID 0149f914962eb10c61e4542830c9f03abf3ed9d5 # Parent a2d5bafdbea9e5eeabaa7f88c50905607926681b perl: Wrap purple_chat_get_components diff -r a2d5bafdbea9 -r 0149f914962e ChangeLog.API --- a/ChangeLog.API Sun Sep 05 01:30:56 2010 +0000 +++ b/ChangeLog.API Mon Sep 06 03:46:24 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 diff -r a2d5bafdbea9 -r 0149f914962e libpurple/plugins/perl/common/BuddyList.xs --- a/libpurple/plugins/perl/common/BuddyList.xs Sun Sep 05 01:30:56 2010 +0000 +++ b/libpurple/plugins/perl/common/BuddyList.xs Mon Sep 06 03:46:24 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