Plugin - gtkblist unhiding event problem

Sławek Mikuła slawek.mikula at gmail.com
Tue Sep 4 16:02:17 EDT 2007


Dnia 04-09-2007, wto o godzinie 09:42 -0500, Richard Laager napisał(a):
> On Mon, 2007-09-03 at 22:09 +0200, Sławek Mikuła wrote:
> > What's wrong with this code ? Maybe there is another way of checking
> all
> > of the buddies (needed for my plugin).
> 
> I didn't see anything immediately wrong with your code, but this
> function (from libpurple/blist.h) would probably simplify it:
> 
> /**
>  * Returns the next node of a given node. This function is to be used
> to iterate
>  * over the tree returned by purple_get_blist.
>  *
>  * @param node          A node.
>  * @param offline       Whether to include nodes for offline accounts
>  * @return      The next node
>  */
> PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node,
> gboolean offline);

Hi,

 Thanks a lot for Your answer. Maybe the exact solution you've provided
hasn't resolved my problem but gives an answer where i can get correct
purple_blist. I was registering an event with:

 void *gtkblist_handle = pidgin_blist_get_handle();

 /* connect signals */
 PURPLE_CALLBACK(buddy_signoff_cb), NULL);
 purple_signal_connect(gtkblist_handle, "gtkblist-unhiding", plugin,
                    PURPLE_CALLBACK(gtkblist_unhiding_cb), NULL);

 and this is wrong (obviously) above gaim 2.0.0b3. I've changed my code
and it looks like here:

  /* check recursively for buddy state */
  for (gnode = purple_get_blist()->root; gnode != NULL; gnode =
gnode->next) {

The new version of the plugin is available at
http://slawek.mikula.googlepages.com/gaim_showoffline

Thanks a lot,
-- 
Slawek






More information about the Devel mailing list