diff plugins/perl/common/BuddyList.xs @ 10631:18223e71ced7

[gaim-migrate @ 12110] sf patch #975984, from Gregory C. Harfst Buddies added from a perl plugin were not being sent to the server. Also, added a hook to the function that returns all buddies for a given account. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 23 Feb 2005 04:31:38 +0000
parents 12169973c663
children cbd13a12d9be
line wrap: on
line diff
--- a/plugins/perl/common/BuddyList.xs	Wed Feb 23 04:21:50 2005 +0000
+++ b/plugins/perl/common/BuddyList.xs	Wed Feb 23 04:31:38 2005 +0000
@@ -8,11 +8,13 @@
 	gboolean show
 
 void
-add_buddy(buddy, group)
+add_buddy(account, buddy, group)
+	Gaim::Account account
 	Gaim::BuddyList::Buddy buddy
 	Gaim::BuddyList::Group group
 CODE:
 	gaim_blist_add_buddy(buddy, NULL, group, NULL);
+	serv_add_buddy(gaim_account_get_connection(account), buddy);
 
 void
 add_group(group)
@@ -63,6 +65,20 @@
 
 	g_slist_free(l);
 
+void
+get_buddies(account)
+	Gaim::Account account
+PREINIT:
+	GSList *l;
+PPCODE:
+	for (l = gaim_get_account_buddies(account); l != NULL; l = l->next)
+	{
+		XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data,
+			"Gaim::BuddyList::Buddy")));
+	}
+
+	g_slist_free(l);
+
 Gaim::BuddyList::Group
 find_group(name)
 	const char *name