Add 'cancel_action' parameter to purple_request_action

Ka-Hing Cheung khc at hxbc.us
Thu Jan 24 15:08:12 EST 2008


On Thu, 2008-01-24 at 15:03 -0500, Mark Doliner wrote:
> Top o' the day to ya,
> 
> I talked with Ka-Hing about this in #pidgin a few nights ago.  I think we
> should add a 'cancel_action' parameter to purple_request_action in
> libpurple/request.c.
> 
> This function takes in a variable list of callback functions which get mapped
> to buttons in the dialog window that is displayed.  We currently have a
> 'default_action' parameter.  This parameter is used to indicate which action
> should be triggered if the user presses the "enter" key when the dialog pops up.
> 
> But what should happen if the dialog is closed using the window manager's "x"
> button?  Currently no callback is triggered, the dialog is closed, and the
> user_data associated with that dialog is leaked.
> 
> Take the "are you sure you want to delete this log?" dialog, for example.  The
> default action is "yes" (because the user probably DOES want to delete the
> log).  Obviously if the user closes the dialog then the "no" action should be
> triggered, but currently NOTHING happens and some data is leaked.
> 
> We would also want to change purple_request_yes_no, purple_request_ok_cancel
> and purple_request_accept_cancel.

This would also fix the problem of a prpl prompting user (for adding a
buddy for example) and then the account is signed off. Currently we just
hide the minidialog in the buddy list, but this may introduce the same
kind of leaks.

-khc





More information about the Devel mailing list