listing buddies through Perl plugin
Sadrul Habib Chowdhury
imadil at gmail.com
Thu May 31 04:09:47 EDT 2007
> > I've been pulling my hair out trying to understand how the Buddy List
> > works. I'm a C newbie and have never used the Perl internals before.
> > How do I iterate through the buddy list after getting it with a call
> > to Purple::get_blist()? I understand that its a node but I can't make
> > heads or tails of how to call the "next" node.
If you want to go over all the nodes in the buddylist, then you would
first do purple_blist_get_root(), which returns the root node of the
buddylist (the buddylist is actually stored in a tree-structure). From
the node you get, you can iteratively do purple_blist_node_next to get
all the groups, chats, contacts and buddies in the list.
Right now, these functions are not exposed for perl plugins, and from
what I see, traversing over the buddylist is not possible from a perl
plugin. I have exposed these two functions, and a new function
purple_blist_node_get_type for perl. So in 2.1.0, you should be able to
use something like the script in http://pidgin.im/~sadrul/pp/blist.pl to
go over the buddy list.
More information about the Devel