changeset 17534:79c1f60ece2e

New function purple_blist_node_get_type. Expose some of the buddylist functions for perl plugins.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 31 May 2007 08:12:19 +0000
parents e91e2b450e5d
children 98dd7d5b646a
files ChangeLog.API libpurple/blist.c libpurple/blist.h libpurple/plugins/perl/common/BuddyList.xs libpurple/plugins/perl/common/module.h libpurple/plugins/perl/common/typemap
diffstat 6 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Thu May 31 05:11:46 2007 +0000
+++ b/ChangeLog.API	Thu May 31 08:12:19 2007 +0000
@@ -8,6 +8,7 @@
 	  information about a user.
 	* gtk_imhtml_setup_entry
 	* purple_xfer_get_remote_user
+	* purple_blist_node_get_type
 
 	Changed:
 	* pidgin_separator returns the separator added to the menu.
--- a/libpurple/blist.c	Thu May 31 05:11:46 2007 +0000
+++ b/libpurple/blist.c	Thu May 31 08:12:19 2007 +0000
@@ -2498,6 +2498,13 @@
 	return node->flags;
 }
 
+PurpleBlistNodeType
+purple_blist_node_get_type(PurpleBlistNode *node)
+{
+	g_return_val_if_fail(node != NULL, PURPLE_BLIST_OTHER_NODE);
+	return node->type;
+}
+
 void
 purple_blist_node_set_bool(PurpleBlistNode* node, const char *key, gboolean data)
 {
--- a/libpurple/blist.h	Thu May 31 05:11:46 2007 +0000
+++ b/libpurple/blist.h	Thu May 31 08:12:19 2007 +0000
@@ -864,6 +864,15 @@
  */
 PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node);
 
+/**
+ * Get the type of a given node.
+ *
+ * @param node The node.
+ *
+ * @return The type of the node.
+ */
+PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node);
+
 /*@}*/
 
 /**
--- a/libpurple/plugins/perl/common/BuddyList.xs	Thu May 31 05:11:46 2007 +0000
+++ b/libpurple/plugins/perl/common/BuddyList.xs	Thu May 31 08:12:19 2007 +0000
@@ -112,6 +112,10 @@
 	Purple::BuddyList::Group  group
 	Purple::Account account
 
+const char *
+purple_group_get_name(group)
+	Purple::BuddyList::Group group
+
 MODULE = Purple::BuddyList  PACKAGE = Purple::BuddyList  PREFIX = purple_blist_
 PROTOTYPES: ENABLE
 
@@ -248,6 +252,9 @@
 Purple::Handle
 purple_blist_get_handle()
 
+Purple::BuddyList::Node
+purple_blist_get_root()
+
 void
 purple_blist_init()
 
@@ -308,6 +315,15 @@
 purple_blist_node_get_flags(node)
 	Purple::BuddyList::Node node
 
+Purple::BuddyList::NodeType
+purple_blist_node_get_type(node)
+	Purple::BuddyList::Node node
+
+Purple::BuddyList::Node
+purple_blist_node_next(node, offline)
+	Purple::BuddyList::Node node
+	gboolean offline
+
 MODULE = Purple::BuddyList  PACKAGE = Purple::BuddyList::Chat  PREFIX = purple_chat_
 PROTOTYPES: ENABLE
 
--- a/libpurple/plugins/perl/common/module.h	Thu May 31 05:11:46 2007 +0000
+++ b/libpurple/plugins/perl/common/module.h	Thu May 31 08:12:19 2007 +0000
@@ -69,6 +69,7 @@
 /* blist.h */
 typedef PurpleBlistNode *			Purple__BuddyList__Node;
 typedef PurpleBlistNodeFlags		Purple__BuddyList__NodeFlags;
+typedef PurpleBlistNodeType		Purple__BuddyList__NodeType;
 typedef PurpleBlistUiOps *		Purple__BuddyList__UiOps;
 typedef PurpleBuddyList *			Purple__BuddyList;
 typedef PurpleBuddy *			Purple__BuddyList__Buddy;
--- a/libpurple/plugins/perl/common/typemap	Thu May 31 05:11:46 2007 +0000
+++ b/libpurple/plugins/perl/common/typemap	Thu May 31 08:12:19 2007 +0000
@@ -52,6 +52,7 @@
 Purple::BuddyList::Group			T_PurpleObj
 Purple::BuddyList::Node			T_PurpleObj
 Purple::BuddyList::NodeFlags		T_IV
+Purple::BuddyList::NodeType		T_IV
 Purple::BuddyList::UiOps			T_PurpleObj
 
 Purple::Cipher				T_PurpleObj