changeset 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 781a0582d35f
children cbd13a12d9be
files plugins/ChangeLog.API plugins/perl/common/BuddyList.xs
diffstat 2 files changed, 28 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ChangeLog.API	Wed Feb 23 04:21:50 2005 +0000
+++ b/plugins/ChangeLog.API	Wed Feb 23 04:31:38 2005 +0000
@@ -7,26 +7,30 @@
 	* Removed: gaim_gtk_sound_{get,set}_mute() (replaced by the
 	           /gaim/gtk/sound/mute preference)
 	* Changed: gtk_imhtml_toolbar now descends from GtkHBox making it
-		   easier to add your own widgets to it
+	           easier to add your own widgets to it
 	* Changed: gaim_find_conversation, added a "type" parameter
 	* Changed: gaim_find_conversation_with_account, added a "type" parameter
 	* Changed: gaim_gtk_prefs_labeled_spin_button, the "key" parameter is
-			   now a const char* instead of just a char*
+	           now a const char* instead of just a char*
 	* Changed: gaim_gtk_prefs_labeled_entry, the "key" parameter is
-			   now a const char* instead of just a char*
+	           now a const char* instead of just a char*
+	* Changed: the add_buddy perl sub.  The argument now takes the account
+	           as the first argument, and buddy and group as the second and
+	           third.  It also adds the buddy to the server-side buddy
+	           list of the given account.
 
 	Signals:
 	* Changed: "received-im-msg and "received-chat-msg" to match, both
-			   now pass a conversation pointer and flags
+	           now pass a conversation pointer and flags
 	* Changed: "receiving-im-msg" and "receving-chat-msg" to match, both
-			   now pass a conversation pointer and a pointer to the flags.
+	           now pass a conversation pointer and a pointer to the flags.
 	* Changed: "drawing-tooltip," the second argument is now a GString*
-			   instead of a char**
+	           instead of a char**
 
 version 1.0.0 (09/17/2004):
 	* Added: get_chat_name to the GaimPluginProtocolInfo struct
 	* Changed: gaim_blist_update_buddy_presence(), presence changed to
-		type gboolean
+	           type gboolean
 	* Changed: the versioning scheme, and all the plugin structs
 
 version 0.82 (08/26/2004):
--- 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