Re-request Authorization with libpurple?

michaelcbrook at msn.com michaelcbrook at msn.com
Wed Aug 12 04:11:59 EDT 2009


On Wed, 2009-08-12 at 00:52 -0700, Paul Aurich wrote:
> On Aug 12, 2009, at 00:39, michaelcbrook at msn.com wrote:
> > Thinking this was another casting issue, I tried casting the type for
> > the callback to PurpleCallback, since that looks like the correct type
> > in libpurple's source code, but I still get the same error that  
> > there's
> > too many arguments:
> >
> > ((PurpleCallback)menu_action->callback)((PurpleBlistNode *)buddy);
> 
> 
> It doesn't look like it's documented anywhere, but the function  
> prototype that you want to be matching is:
> 	void callback(PurpleBlistNode*, gpointer cb_data)
> 
> See, for example, gtkutils.c:menu_action_cb:
> 	static void
> 	menu_action_cb(GtkMenuItem *item, gpointer object)
> 	{
> 	    gpointer data;
> 	    void (*callback)(gpointer, gpointer);
> 
> 	    callback = g_object_get_data(G_OBJECT(item), "purplecallback");
> 	    data = g_object_get_data(G_OBJECT(item), "purplecallbackdata");
> 
> 	    if (callback)
> 	        callback(object, data);
> 	}
> 
> (in your case, you'd have (PurpleBlistNode*)buddy and menu_action->data)
> 
> ~Paul
> 
> 
I think I get what you're saying, I gave the callback function a second
argument for menu_action->data, but the compiler still says that I have
too many arguments...why is it telling me this?

Here's my callback at the moment:
menu_action->callback(((PurpleBlistNode *)buddy), menu_action->data);

-Michael




More information about the Support mailing list