Tue, 10 Sep 2013 21:47:37 +0200
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
--- a/finch/gntaccount.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntaccount.c Tue Sep 10 21:47:37 2013 +0200 @@ -719,10 +719,9 @@ purple_account_get_username(account)); purple_request_action(account, _("Delete Account"), prompt, NULL, - PURPLE_DEFAULT_ACTION_NONE, - account, NULL, NULL, account, 2, - _("Delete"), really_delete_account, - _("Cancel"), NULL); + PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_account(account), account, 2, + _("Delete"), really_delete_account, _("Cancel"), NULL); g_free(prompt); } @@ -1014,12 +1013,11 @@ data->alias = (alias != NULL ? g_strdup(alias) : NULL); buffer = make_info(account, gc, remote_user, id, alias, msg); - purple_request_action(NULL, NULL, _("Add buddy to your list?"), - buffer, PURPLE_DEFAULT_ACTION_NONE, - account, remote_user, NULL, - data, 2, - _("Add"), G_CALLBACK(add_user_cb), - _("Cancel"), G_CALLBACK(free_add_user_data)); + purple_request_action(NULL, NULL, _("Add buddy to your list?"), buffer, + PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_account(account), data, 2, + _("Add"), G_CALLBACK(add_user_cb), + _("Cancel"), G_CALLBACK(free_add_user_data)); g_free(buffer); } @@ -1104,7 +1102,7 @@ widget = purple_request_action(NULL, _("Authorize buddy?"), buffer, NULL, PURPLE_DEFAULT_ACTION_NONE, - account, remote_user, NULL, + purple_request_cpar_from_account(account), aa, 2, _("Authorize"), authorize_and_add_cb, _("Deny"), deny_no_add_cb); @@ -1131,7 +1129,7 @@ } else { uihandle = purple_request_action(NULL, _("Authorize buddy?"), buffer, NULL, PURPLE_DEFAULT_ACTION_NONE, - account, remote_user, NULL, + purple_request_cpar_from_account(account), user_data, 2, _("Authorize"), auth_cb, _("Deny"), deny_cb);
--- a/finch/gntblist.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntblist.c Tue Sep 10 21:47:37 2013 +0200 @@ -1534,7 +1534,7 @@ purple_request_action(node, _("Confirm Remove"), primary, sec, 1, - account, name, NULL, + purple_request_cpar_from_account(account), node, 2, _("Remove"), finch_blist_remove_node, _("Cancel"), NULL);
--- a/finch/gntcertmgr.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntcertmgr.c Tue Sep 10 21:47:37 2013 +0200 @@ -235,7 +235,7 @@ purple_request_yes_no((void *)key, _("Confirm certificate delete"), primary, NULL, 0, - NULL, NULL, NULL, + NULL, g_strdup(key), tls_peers_mgmt_delete_confirm_cb, g_free);
--- a/finch/gntconn.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntconn.c Tue Sep 10 21:47:37 2013 +0200 @@ -132,8 +132,7 @@ "correct the error and re-enable the account."), text); purple_request_action(account, NULL, primary, secondary, 2, - account, NULL, NULL, - account, 3, + purple_request_cpar_from_account(account), account, 3, _("OK"), NULL, _("Modify Account"), PURPLE_CALLBACK(ce_modify_account_cb), _("Re-enable Account"), PURPLE_CALLBACK(ce_enable_account_cb));
--- a/finch/gntpounce.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntpounce.c Tue Sep 10 21:47:37 2013 +0200 @@ -675,8 +675,7 @@ pouncee = purple_pounce_get_pouncee(pounce); buf = g_strdup_printf(_("Are you sure you want to delete the pounce on %s for %s?"), pouncee, pouncer); purple_request_action(pounce, NULL, buf, NULL, 0, - account, pouncee, NULL, - pounce, 2, + purple_request_cpar_from_account(account), pounce, 2, _("Delete"), pounces_manager_delete_confirm_cb, _("Cancel"), NULL); g_free(buf);
--- a/finch/gntrequest.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntrequest.c Tue Sep 10 21:47:37 2013 +0200 @@ -257,7 +257,7 @@ static void* finch_request_action(const char *title, const char *primary, const char *secondary, int default_value, - PurpleAccount *account, const char *who, PurpleConversation *conv, + PurpleRequestCommonParameters *cpar, void *user_data, size_t actioncount, va_list actions) {
--- a/finch/gntstatus.c Tue Sep 10 15:34:10 2013 +0200 +++ b/finch/gntstatus.c Tue Sep 10 21:47:37 2013 +0200 @@ -141,8 +141,7 @@ purple_savedstatus_get_title(saved)); purple_request_action(saved, _("Delete Status"), ask, NULL, 0, - NULL, NULL, NULL, - saved, 2, + NULL, saved, 2, _("Delete"), really_delete_status, _("Cancel"), NULL); g_free(ask);
--- a/libpurple/conversation.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/conversation.c Tue Sep 10 21:47:37 2013 +0200 @@ -1430,10 +1430,10 @@ data[1] = (gpointer)message; purple_request_action(conv, NULL, _("Send Message"), text, 0, - purple_conversation_get_account(conv), NULL, conv, - data, 2, - _("_Send Message"), G_CALLBACK(purple_conv_send_confirm_cb), - _("Cancel"), NULL); + purple_request_cpar_from_account( + purple_conversation_get_account(conv)), + data, 2, _("_Send Message"), + G_CALLBACK(purple_conv_send_confirm_cb), _("Cancel"), NULL); } void
--- a/libpurple/ft.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/ft.c Tue Sep 10 21:47:37 2013 +0200 @@ -498,6 +498,7 @@ /* If we have already accepted the request, ask the destination file name directly */ if (purple_xfer_get_status(xfer) != PURPLE_XFER_STATUS_ACCEPTED) { + PurpleRequestCommonParameters *cpar; PurpleBuddy *buddy = purple_find_buddy(xfer->account, xfer->who); if (purple_xfer_get_filename(xfer) != NULL) @@ -519,19 +520,17 @@ serv_got_im(purple_account_get_connection(xfer->account), xfer->who, xfer->message, 0, time(NULL)); + cpar = purple_request_cpar_from_account(xfer->account); if ((thumb = purple_xfer_get_thumbnail(xfer, &thumb_size))) { - purple_request_accept_cancel_with_icon(xfer, NULL, buf, NULL, - PURPLE_DEFAULT_ACTION_NONE, xfer->account, xfer->who, NULL, - thumb, thumb_size, xfer, - G_CALLBACK(purple_xfer_choose_file), - G_CALLBACK(cancel_recv_cb)); - } else { - purple_request_accept_cancel(xfer, NULL, buf, NULL, - PURPLE_DEFAULT_ACTION_NONE, xfer->account, xfer->who, NULL, - xfer, G_CALLBACK(purple_xfer_choose_file), - G_CALLBACK(cancel_recv_cb)); + purple_request_cpar_set_custom_icon(cpar, thumb, + thumb_size); } + purple_request_accept_cancel(xfer, NULL, buf, NULL, + PURPLE_DEFAULT_ACTION_NONE, cpar, xfer, + G_CALLBACK(purple_xfer_choose_file), + G_CALLBACK(cancel_recv_cb)); + g_free(buf); } else purple_xfer_choose_file(xfer); @@ -569,11 +568,9 @@ purple_xfer_get_remote_ip(xfer), purple_xfer_get_remote_port(xfer)); purple_request_accept_cancel(xfer, NULL, buf, buf2, - PURPLE_DEFAULT_ACTION_NONE, - xfer->account, xfer->who, NULL, - xfer, - G_CALLBACK(ask_accept_ok), - G_CALLBACK(ask_accept_cancel)); + PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_account(xfer->account), xfer, + G_CALLBACK(ask_accept_ok), G_CALLBACK(ask_accept_cancel)); g_free(buf); g_free(buf2); }
--- a/libpurple/plugins/offlinemsg.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/plugins/offlinemsg.c Tue Sep 10 21:47:37 2013 +0200 @@ -165,8 +165,7 @@ purple_request_action(handle, _("Offline Message"), ask, _("You can edit/delete the pounce from the `Buddy Pounces' dialog"), - 0, - offline->account, offline->who, offline->conv, + 0, purple_request_cpar_from_conversation(offline->conv), offline, 2, _("Yes"), record_pounce, _("No"), cancel_poune);
--- a/libpurple/plugins/perl/common/Request.xs Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/plugins/perl/common/Request.xs Tue Sep 10 21:47:37 2013 +0200 @@ -144,7 +144,7 @@ gpr->cancel_fun = purple_perl_sv_from_fun(handle, cancel_cb); g_free(basename); - RETVAL = purple_request_input(handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, G_CALLBACK(purple_perl_request_ok_cb), cancel_text, G_CALLBACK(purple_perl_request_cancel_cb), NULL, NULL, NULL, gpr); + RETVAL = purple_request_input(handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, G_CALLBACK(purple_perl_request_ok_cb), cancel_text, G_CALLBACK(purple_perl_request_cancel_cb), NULL, gpr); OUTPUT: RETVAL
--- a/libpurple/protocols/gg/purplew.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/gg/purplew.c Tue Sep 10 21:47:37 2013 +0200 @@ -69,8 +69,8 @@ handle->user_data = user_data; handle->request_handle = purple_request_action(gc, _("Please wait..."), (msg ? msg : _("Please wait...")), NULL, - PURPLE_DEFAULT_ACTION_NONE, purple_connection_get_account(gc), - NULL, NULL, handle, 1, + PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_connection(gc), handle, 1, _("Cancel"), G_CALLBACK(ggp_purplew_request_processing_cancel)); return handle;
--- a/libpurple/protocols/jabber/auth.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/jabber/auth.c Tue Sep 10 21:47:37 2013 +0200 @@ -313,7 +313,7 @@ _("Plaintext Authentication"), msg, 1, - account, NULL, NULL, + purple_request_cpar_from_account(account), account, allow_plaintext_auth, disallow_plaintext_auth); g_free(msg);
--- a/libpurple/protocols/jabber/auth_plain.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/jabber/auth_plain.c Tue Sep 10 21:47:37 2013 +0200 @@ -97,7 +97,7 @@ _("Plaintext Authentication"), msg, 1, - account, NULL, NULL, + purple_request_cpar_from_account(account), account, allow_plaintext_auth, disallow_plaintext_auth); g_free(msg); return JABBER_SASL_STATE_CONTINUE;
--- a/libpurple/protocols/jabber/buddy.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/jabber/buddy.c Tue Sep 10 21:47:37 2013 +0200 @@ -1755,7 +1755,7 @@ msg = g_strdup_printf(_("%s will no longer be able to see your status " "updates. Do you want to continue?"), name); purple_request_yes_no(gc, NULL, _("Cancel Presence Notification"), - msg, 0 /* Yes */, account, name, NULL, buddy, + msg, 0 /* Yes */, purple_request_cpar_from_account(account), buddy, cancel_presence_notification, NULL /* Do nothing */); g_free(msg); }
--- a/libpurple/protocols/jabber/presence.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/jabber/presence.c Tue Sep 10 21:47:37 2013 +0200 @@ -600,7 +600,7 @@ " you like to configure it, or" " accept the default settings?"), /* Default Action */ 1, - purple_connection_get_account(js->gc), NULL, chat->conv, + purple_request_cpar_from_conversation(chat->conv), chat, 2, _("_Configure Room"), G_CALLBACK(jabber_chat_request_room_configure), _("_Accept Defaults"), G_CALLBACK(jabber_chat_create_instant_room));
--- a/libpurple/protocols/msn/error.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/msn/error.c Tue Sep 10 21:47:37 2013 +0200 @@ -373,7 +373,7 @@ } purple_request_action(gc, NULL, msg, reason, PURPLE_DEFAULT_ACTION_NONE, - account, data->who, NULL, + purple_request_cpar_from_account(account), data, 2, _("Yes"), G_CALLBACK(msn_add_cb), _("No"), G_CALLBACK(msn_rem_cb));
--- a/libpurple/protocols/msn/msn.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/msn/msn.c Tue Sep 10 21:47:37 2013 +0200 @@ -634,7 +634,7 @@ _("Do you want to allow or disallow connecting from " "multiple locations simultaneously?"), PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(pc), NULL, NULL, + purple_request_cpar_from_connection(pc), pc, 3, _("Allow"), G_CALLBACK(enable_mpop_cb), _("Disallow"), G_CALLBACK(disable_mpop_cb), @@ -704,7 +704,7 @@ "your buddy list to send you MSN Mobile pages " "to your cell phone or other mobile device?"), PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), NULL, NULL, + purple_request_cpar_from_connection(gc), gc, 3, _("Allow"), G_CALLBACK(enable_msn_pages_cb), _("Disallow"), G_CALLBACK(disable_msn_pages_cb),
--- a/libpurple/protocols/msn/userlist.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/msn/userlist.c Tue Sep 10 21:47:37 2013 +0200 @@ -468,8 +468,7 @@ purple_request_yes_no(userlist->session->account, _("Delete Buddy from Address Book?"), _("Do you want to delete this buddy from your address book as well?"), - user->passport, 0, userlist->session->account, user->passport, - NULL, ab, + user->passport, 0, purple_request_cpar_from_account(userlist->session->account), ab, G_CALLBACK(userlist_ab_delete_cb), G_CALLBACK(userlist_ab_delete_cb)); } else msn_delete_contact(userlist->session, user);
--- a/libpurple/protocols/myspace/myspace.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/myspace/myspace.c Tue Sep 10 21:47:37 2013 +0200 @@ -799,9 +799,7 @@ _("You appear to have no MySpace username."), _("Would you like to set one now? (Note: THIS CANNOT BE CHANGED!)"), 0, - session->account, - NULL, - NULL, + purple_request_cpar_from_account(session->account), session->gc, G_CALLBACK(msim_set_username_cb), G_CALLBACK(msim_do_not_set_username_cb));
--- a/libpurple/protocols/myspace/user.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/myspace/user.c Tue Sep 10 21:47:37 2013 +0200 @@ -819,9 +819,7 @@ _("This username is available. Would you like to set it?"), _("ONCE SET, THIS CANNOT BE CHANGED!"), 0, - session->account, - NULL, - NULL, + purple_request_cpar_from_account(session->account), session->gc, G_CALLBACK(msim_set_username_confirmed_cb), G_CALLBACK(msim_do_not_set_username_cb));
--- a/libpurple/protocols/novell/novell.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/novell/novell.c Tue Sep 10 21:47:37 2013 +0200 @@ -1933,7 +1933,7 @@ gc = purple_account_get_connection(user->client_data); purple_request_action(gc, title, primary, secondary, PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), name, NULL, + purple_request_cpar_from_connection(gc), parms, 2, _("Yes"), G_CALLBACK(_join_conference_cb), _("No"), G_CALLBACK(_reject_conference_cb));
--- a/libpurple/protocols/oscar/oscar.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/oscar/oscar.c Tue Sep 10 21:47:37 2013 +0200 @@ -1831,7 +1831,7 @@ _("Do you want to add this buddy " "to your buddy list?"), PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), data->name, NULL, + purple_request_cpar_from_connection(gc), data, 2, _("_Add"), G_CALLBACK(purple_icq_buddyadd), _("_Decline"), G_CALLBACK(oscar_free_name_data)); @@ -4102,7 +4102,7 @@ purple_request_yes_no(gc, NULL, _("Authorization Given"), dialog_msg, PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), bn, NULL, + purple_request_cpar_from_connection(gc), data, G_CALLBACK(purple_icq_buddyadd), G_CALLBACK(oscar_free_name_data)); @@ -4785,7 +4785,7 @@ "may be considered a security risk. Do you " "wish to continue?"), 0, /* Default action is "connect" */ - account, data->who, NULL, + purple_request_cpar_from_account(account), data, 2, _("C_onnect"), G_CALLBACK(oscar_ask_directim_yes_cb), _("_Cancel"), G_CALLBACK(oscar_ask_directim_no_cb));
--- a/libpurple/protocols/oscar/peer.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/oscar/peer.c Tue Sep 10 21:47:37 2013 +0200 @@ -1099,7 +1099,7 @@ "revealed, this may be considered a privacy " "risk."), PURPLE_DEFAULT_ACTION_NONE, - account, bn, NULL, + purple_request_cpar_from_account(account), conn, 2, _("C_onnect"), G_CALLBACK(peer_connection_got_proposition_yes_cb), _("Cancel"), G_CALLBACK(peer_connection_got_proposition_no_cb));
--- a/libpurple/protocols/silc/buddy.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/silc/buddy.c Tue Sep 10 21:47:37 2013 +0200 @@ -314,8 +314,8 @@ a->port = port; purple_request_action(client->application, _("Key Agreement Request"), tmp, - hostname ? tmp2 : NULL, 1, purple_connection_get_account(gc), client_entry->nickname, - NULL, a, 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb), + hostname ? tmp2 : NULL, 1, purple_request_cpar_from_connection(gc), + a, 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb), _("No"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb)); } @@ -1080,7 +1080,7 @@ purple_request_action(r->client->application, _("Add Buddy"), tmp, _("To add the buddy you must import his/her public key. " "Press Import to import a public key."), 0, - purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r, 2, + purple_request_cpar_from_account(purple_buddy_get_account(r->b)), r, 2, _("Cancel"), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb), _("_Import..."), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb)); }
--- a/libpurple/protocols/silc/pk.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/silc/pk.c Tue Sep 10 21:47:37 2013 +0200 @@ -110,7 +110,7 @@ purple_request_action(gc, _("Verify Public Key"), tmp, tmp2, PURPLE_DEFAULT_ACTION_NONE, - purple_connection_get_account(gc), entity, NULL, verify, 3, + purple_request_cpar_from_connection(gc), verify, 3, _("Yes"), G_CALLBACK(silcpurple_verify_cb), _("No"), G_CALLBACK(silcpurple_verify_cb), _("_View..."), G_CALLBACK(silcpurple_verify_details));
--- a/libpurple/protocols/silc/util.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/silc/util.c Tue Sep 10 21:47:37 2013 +0200 @@ -407,8 +407,8 @@ purple_request_action(sg->gc, _("Public Key Information"), _("Public Key Information"), - s->str, 0, purple_connection_get_account(sg->gc), - NULL, NULL, context, 1, _("Close"), callback); + s->str, 0, purple_request_cpar_from_connection(sg->gc), + context, 1, _("Close"), callback); g_string_free(s, TRUE); silc_free(fingerprint);
--- a/libpurple/protocols/silc/wb.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/silc/wb.c Tue Sep 10 21:47:37 2013 +0200 @@ -304,7 +304,7 @@ req->sg = sg; purple_request_action(gc, _("Whiteboard"), tmp, NULL, 1, - sg->account, sender->nickname, NULL, req, 2, + purple_request_cpar_from_connection(gc), req, 2, _("Yes"), G_CALLBACK(silcpurple_wb_request_cb), _("No"), G_CALLBACK(silcpurple_wb_request_cb)); }
--- a/libpurple/protocols/yahoo/libymsg.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/protocols/yahoo/libymsg.c Tue Sep 10 21:47:37 2013 +0200 @@ -2126,11 +2126,11 @@ g_snprintf(buf, sizeof(buf), _("You have tried to ignore %s, but the " "user is on your buddy list. Clicking \"Yes\" " "will remove and ignore the buddy."), who); - purple_request_yes_no(gc, NULL, _("Ignore buddy?"), buf, 0, - purple_connection_get_account(gc), who, NULL, - b, - G_CALLBACK(ignore_buddy), - G_CALLBACK(keep_buddy)); + purple_request_yes_no(gc, NULL, + _("Ignore buddy?"), buf, 0, + purple_request_cpar_from_connection(gc), + b, G_CALLBACK(ignore_buddy), + G_CALLBACK(keep_buddy)); break; } case 2:
--- a/libpurple/request.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/request.c Tue Sep 10 21:47:37 2013 +0200 @@ -162,6 +162,8 @@ PurpleAccount *account; PurpleConversation *conv; + gconstpointer icon_data; + gsize icon_size; }; PurpleRequestCommonParameters * @@ -190,6 +192,24 @@ return cpar; } +PurpleRequestCommonParameters * +purple_request_cpar_from_conversation(PurpleConversation *conv) +{ + PurpleRequestCommonParameters *cpar; + PurpleAccount *account = NULL; + + if (conv != NULL) { + account = purple_connection_get_account( + purple_conversation_get_connection(conv)); + } + + cpar = purple_request_cpar_new(); + purple_request_cpar_set_account(cpar, account); + purple_request_cpar_set_conversation(cpar, conv); + + return cpar; +} + void purple_request_cpar_ref(PurpleRequestCommonParameters *cpar) { @@ -247,6 +267,32 @@ return cpar->conv; } +void +purple_request_cpar_set_custom_icon(PurpleRequestCommonParameters *cpar, + gconstpointer icon_data, gsize icon_size) +{ + g_return_if_fail(cpar != NULL); + g_return_if_fail((icon_data == NULL) == (icon_size == 0)); + + cpar->icon_data = icon_data; + cpar->icon_size = icon_size; +} + +gconstpointer +purple_request_cpar_get_custom_icon(PurpleRequestCommonParameters *cpar, + gsize *icon_size) +{ + if (cpar == NULL) { + if (icon_size != NULL) + *icon_size = 0; + return NULL; + } + + if (icon_size != NULL) + *icon_size = cpar->icon_size; + return cpar->icon_data; +} + PurpleRequestFields * purple_request_fields_new(void) { @@ -1766,49 +1812,26 @@ void * purple_request_action(void *handle, const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, PurpleConversation *conv, - void *user_data, size_t action_count, ...) + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, + size_t action_count, ...) { void *ui_handle; va_list args; va_start(args, action_count); - ui_handle = purple_request_action_varg(handle, title, primary, secondary, - default_action, account, who, conv, - user_data, action_count, args); + ui_handle = purple_request_action_varg(handle, title, primary, + secondary, default_action, cpar, user_data, action_count, args); va_end(args); return ui_handle; } void * -purple_request_action_with_icon(void *handle, const char *title, - const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, gconstpointer icon_data, - gsize icon_size, void *user_data, size_t action_count, ...) -{ - void *ui_handle; - va_list args; - - va_start(args, action_count); - ui_handle = purple_request_action_with_icon_varg(handle, title, primary, - secondary, default_action, account, who, conv, icon_data, icon_size, - user_data, action_count, args); - va_end(args); - - return ui_handle; -} - - -void * -purple_request_action_varg(void *handle, const char *title, - const char *primary, const char *secondary, - int default_action, - PurpleAccount *account, const char *who, PurpleConversation *conv, - void *user_data, size_t action_count, va_list actions) +purple_request_action_varg(void *handle, const char *title, const char *primary, + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, + size_t action_count, va_list actions) { PurpleRequestUiOps *ops; @@ -1821,8 +1844,7 @@ info->type = PURPLE_REQUEST_ACTION; info->handle = handle; info->ui_handle = ops->request_action(title, primary, secondary, - default_action, account, who, conv, - user_data, action_count, actions); + default_action, cpar, user_data, action_count, actions); handles = g_list_append(handles, info); @@ -1833,44 +1855,6 @@ } void * -purple_request_action_with_icon_varg(void *handle, const char *title, - const char *primary, const char *secondary, - int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, gconstpointer icon_data, - gsize icon_size, - void *user_data, size_t action_count, va_list actions) -{ - PurpleRequestUiOps *ops; - - ops = purple_request_get_ui_ops(); - - if (ops != NULL && ops->request_action_with_icon != NULL) { - PurpleRequestInfo *info; - - info = g_new0(PurpleRequestInfo, 1); - info->type = PURPLE_REQUEST_ACTION; - info->handle = handle; - info->ui_handle = ops->request_action_with_icon(title, primary, secondary, - default_action, account, who, conv, - icon_data, icon_size, - user_data, action_count, actions); - - handles = g_list_append(handles, info); - - return info->ui_handle; - } else { - /* Fall back on the non-icon request if the UI doesn't support icon - requests */ - return purple_request_action_varg(handle, title, primary, secondary, - default_action, account, who, conv, user_data, action_count, actions); - } - - return NULL; -} - - -void * purple_request_fields(void *handle, const char *title, const char *primary, const char *secondary, PurpleRequestFields *fields, const char *ok_text, GCallback ok_cb,
--- a/libpurple/request.h Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/request.h Tue Sep 10 21:47:37 2013 +0200 @@ -113,9 +113,9 @@ /** @see purple_request_action_varg(). */ void *(*request_action)(const char *title, const char *primary, const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data, - size_t action_count, va_list actions); + PurpleRequestCommonParameters *cpar, + void *user_data, size_t action_count, + va_list actions); /** @see purple_request_fields(). */ void *(*request_fields)(const char *title, const char *primary, @@ -140,18 +140,10 @@ PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data); - /** @see purple_request_action_with_icon_varg(). */ - void *(*request_action_with_icon)(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, - gconstpointer icon_data, gsize icon_size, - void *user_data, - size_t action_count, va_list actions); - void (*_purple_reserved1)(void); void (*_purple_reserved2)(void); void (*_purple_reserved3)(void); + void (*_purple_reserved4)(void); } PurpleRequestUiOps; typedef void (*PurpleRequestInputCb)(void *, const char *); @@ -200,6 +192,14 @@ PurpleRequestCommonParameters * purple_request_cpar_from_account(PurpleAccount *account); +/** + * Creates new parameters set initially bound with the #PurpleConversation. + * + * @return The new parameters set. + */ +PurpleRequestCommonParameters * +purple_request_cpar_from_conversation(PurpleConversation *conv); + /* * Increases the reference count on the parameters set. * @@ -261,6 +261,30 @@ PurpleConversation * purple_request_cpar_get_conversation(PurpleRequestCommonParameters *cpar); +/** + * Sets the custom icon associated with the request. + * + * @param cpar The parameters set. + * @param icon_data The icon image contents (@c NULL to reset). + * @param icon_size The icon image size. + */ +void +purple_request_cpar_set_custom_icon(PurpleRequestCommonParameters *cpar, + gconstpointer icon_data, gsize icon_size); + +/** + * Gets the custom icon associated with the request. + * + * @param cpar The parameters set (may be @c NULL). + * @param icon_size The pointer to variable, where icon size should be stored + * (may be @c NULL). + * + * @return The icon image contents. + */ +gconstpointer +purple_request_cpar_get_custom_icon(PurpleRequestCommonParameters *cpar, + gsize *icon_size); + /*@}*/ /**************************************************************************/ @@ -1555,12 +1579,8 @@ * supplied should be the default, supply <tt>2</tt>. * The should be the action that users are most likely * to select. - * @param account The #PurpleAccount associated with this request, or @c - * NULL if none is. - * @param who The username of the buddy associated with this request, - * or @c NULL if none is. - * @param conv The #PurpleConversation associated with this request, or - * @c NULL if none is. + * @param cpar The #PurpleRequestCommonParameters object, which gets + * unref'ed after this call. * @param user_data The data to pass to the callback. * @param action_count The number of actions. * @param ... A list of actions. These are pairs of @@ -1573,39 +1593,20 @@ * * @return A UI-specific handle. */ -void *purple_request_action(void *handle, const char *title, const char *primary, - const char *secondary, int default_action, PurpleAccount *account, - const char *who, PurpleConversation *conv, void *user_data, +void * +purple_request_action(void *handle, const char *title, const char *primary, + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, size_t action_count, ...); /** * <tt>va_list</tt> version of purple_request_action(); see its documentation. */ -void *purple_request_action_varg(void *handle, const char *title, - const char *primary, const char *secondary, int default_action, - PurpleAccount *account, const char *who, PurpleConversation *conv, - void *user_data, size_t action_count, va_list actions); - -/** - * Version of purple_request_action() supplying an image for the UI to - * optionally display as an icon in the dialog; see its documentation. - */ -void *purple_request_action_with_icon(void *handle, const char *title, - const char *primary, const char *secondary, int default_action, - PurpleAccount *account, const char *who, PurpleConversation *conv, - gconstpointer icon_data, gsize icon_size, void *user_data, - size_t action_count, ...); - -/** - * <tt>va_list</tt> version of purple_request_action_with_icon(); - * see its documentation. - */ -void *purple_request_action_with_icon_varg(void *handle, const char *title, - const char *primary, const char *secondary, int default_action, - PurpleAccount *account, const char *who, PurpleConversation *conv, - gconstpointer icon_data, gsize icon_size, - void *user_data, size_t action_count, va_list actions); - +void * +purple_request_action_varg(void *handle, const char *title, const char *primary, + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, + size_t action_count, va_list actions); /** * Displays groups of fields for the user to fill in. @@ -1665,44 +1666,28 @@ * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. */ #define purple_request_yes_no(handle, title, primary, secondary, \ - default_action, account, who, conv, \ - user_data, yes_cb, no_cb) \ + default_action, cpar, user_data, yes_cb, no_cb) \ purple_request_action((handle), (title), (primary), (secondary), \ - (default_action), account, who, conv, (user_data), 2, \ - _("_Yes"), (yes_cb), _("_No"), (no_cb)) + (default_action), (cpar), (user_data), 2, _("_Yes"), (yes_cb), \ + _("_No"), (no_cb)) /** * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. */ #define purple_request_ok_cancel(handle, title, primary, secondary, \ - default_action, account, who, conv, \ - user_data, ok_cb, cancel_cb) \ + default_action, cpar, user_data, ok_cb, cancel_cb) \ purple_request_action((handle), (title), (primary), (secondary), \ - (default_action), account, who, conv, (user_data), 2, \ - _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) + (default_action), (cpar), (user_data), 2, _("_OK"), (ok_cb), \ + _("_Cancel"), (cancel_cb)) /** * A wrapper for purple_request_action() that uses Accept and Cancel buttons. */ #define purple_request_accept_cancel(handle, title, primary, secondary, \ - default_action, account, who, conv, \ - user_data, accept_cb, cancel_cb) \ + default_action, cpar, user_data, accept_cb, cancel_cb) \ purple_request_action((handle), (title), (primary), (secondary), \ - (default_action), account, who, conv, (user_data), 2, \ - _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) - -/** - * A wrapper for purple_request_action_with_icon() that uses Accept and Cancel - * buttons. - */ -#define purple_request_accept_cancel_with_icon(handle, title, primary, secondary, \ - default_action, account, who, conv, \ - icon_data, icon_size, \ - user_data, accept_cb, cancel_cb) \ - purple_request_action_with_icon((handle), (title), (primary), (secondary), \ - (default_action), account, who, conv, icon_data, icon_size, \ - (user_data), 2, \ - _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) + (default_action), (cpar), (user_data), 2, _("_Accept"), \ + (accept_cb), _("_Cancel"), (cancel_cb)) /** * Displays a file selector request dialog. Returns the selected filename to
--- a/libpurple/server.c Tue Sep 10 15:34:10 2013 +0200 +++ b/libpurple/server.c Tue Sep 10 21:47:37 2013 +0200 @@ -807,10 +807,12 @@ who, purple_account_get_username(account), name); - purple_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), buf2, - PURPLE_DEFAULT_ACTION_NONE, account, who, NULL, - cid, G_CALLBACK(chat_invite_accept), - G_CALLBACK(chat_invite_reject)); + purple_request_accept_cancel(gc, NULL, + _("Accept chat invitation?"), buf2, + PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_connection(gc), cid, + G_CALLBACK(chat_invite_accept), + G_CALLBACK(chat_invite_reject)); } else if (plugin_return > 0) chat_invite_accept(cid);
--- a/pidgin/gtkaccount.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkaccount.c Tue Sep 10 21:47:37 2013 +0200 @@ -2122,11 +2122,9 @@ purple_request_close_with_handle(account); purple_request_action(account, NULL, buf, NULL, - PURPLE_DEFAULT_ACTION_NONE, - account, NULL, NULL, - account, 2, - _("Delete"), delete_account_cb, - _("Cancel"), NULL); + PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_account(account), account, 2, + _("Delete"), delete_account_cb, _("Cancel"), NULL); g_free(buf); } }
--- a/pidgin/gtkblist.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkblist.c Tue Sep 10 21:47:37 2013 +0200 @@ -576,7 +576,7 @@ { char *msg = g_strdup_printf(ngettext("You have %d contact named %s. Would you like to merge them?", "You currently have %d contacts named %s. Would you like to merge them?", i), i, alias); purple_request_action(NULL, NULL, msg, _("Merging these contacts will cause them to share a single entry on the buddy list and use a single conversation window. " - "You can separate them again by choosing 'Expand' from the contact's context menu"), 0, NULL, NULL, NULL, + "You can separate them again by choosing 'Expand' from the contact's context menu"), 0, NULL, merges, 2, _("_Yes"), PURPLE_CALLBACK(gtk_blist_do_personize), _("_No"), PURPLE_CALLBACK(g_list_free)); g_free(msg); } else
--- a/pidgin/gtkcertmgr.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkcertmgr.c Tue Sep 10 21:47:37 2013 +0200 @@ -382,7 +382,7 @@ purple_request_yes_no(tpm_dat, _("Confirm certificate delete"), primary, NULL, /* Can this be NULL? */ 0, /* "yes" is the default action */ - NULL, NULL, NULL, + NULL, id, /* id ownership passed to callback */ tls_peers_mgmt_delete_confirm_cb, tls_peers_mgmt_delete_confirm_cb );
--- a/pidgin/gtkdialogs.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkdialogs.c Tue Sep 10 21:47:37 2013 +0200 @@ -1267,7 +1267,7 @@ purple_buddy_get_name(buddy), purple_contact_get_contact_size(contact, TRUE) - 1); purple_request_action(contact, NULL, _("Remove Contact"), text, 0, - NULL, purple_contact_get_alias(contact), NULL, + NULL, contact, 2, _("_Remove Contact"), G_CALLBACK(pidgin_dialogs_remove_contact_cb), _("Cancel"), @@ -1308,7 +1308,7 @@ ggp->new_name = g_strdup(new_name); purple_request_action(source, NULL, _("Merge Groups"), text, 0, - NULL, NULL, NULL, + NULL, ggp, 2, _("_Merge Groups"), G_CALLBACK(pidgin_dialogs_merge_groups_cb), _("Cancel"), G_CALLBACK(free_ggmo)); @@ -1364,7 +1364,7 @@ purple_group_get_name(group)); purple_request_action(group, NULL, _("Remove Group"), text, 0, - NULL, NULL, NULL, + NULL, group, 2, _("_Remove Group"), G_CALLBACK(pidgin_dialogs_remove_group_cb), _("Cancel"), NULL); @@ -1403,10 +1403,10 @@ purple_buddy_get_name(buddy)); purple_request_action(buddy, NULL, _("Remove Buddy"), text, 0, - purple_buddy_get_account(buddy), purple_buddy_get_name(buddy), NULL, - buddy, 2, - _("_Remove Buddy"), G_CALLBACK(pidgin_dialogs_remove_buddy_cb), - _("Cancel"), NULL); + purple_request_cpar_from_account( + purple_buddy_get_account(buddy)), + buddy, 2, _("_Remove Buddy"), + G_CALLBACK(pidgin_dialogs_remove_buddy_cb), _("Cancel"), NULL); g_free(text); } @@ -1430,10 +1430,9 @@ name ? name : ""); purple_request_action(chat, NULL, _("Remove Chat"), text, 0, - purple_chat_get_account(chat), NULL, NULL, - chat, 2, - _("_Remove Chat"), G_CALLBACK(pidgin_dialogs_remove_chat_cb), - _("Cancel"), NULL); + purple_request_cpar_from_account(purple_chat_get_account(chat)), + chat, 2, _("_Remove Chat"), + G_CALLBACK(pidgin_dialogs_remove_chat_cb), _("Cancel"), NULL); g_free(text); }
--- a/pidgin/gtklog.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtklog.c Tue Sep 10 21:47:37 2013 +0200 @@ -320,7 +320,7 @@ data2[1] = data[3]; /* iter */ data2[2] = log; purple_request_action(lv, NULL, _("Delete Log?"), tmp, 0, - NULL, NULL, NULL, + NULL, data2, 2, _("Delete"), delete_log_cb, _("Cancel"), delete_log_cleanup_cb);
--- a/pidgin/gtkmedia.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkmedia.c Tue Sep 10 21:47:37 2013 +0200 @@ -657,11 +657,10 @@ gtkmedia->priv->request_type = PURPLE_MEDIA_NONE; if (!purple_media_accepted(gtkmedia->priv->media, NULL, NULL)) { purple_request_accept_cancel(gtkmedia, _("Incoming Call"), - message, NULL, PURPLE_DEFAULT_ACTION_NONE, - (void*)account, gtkmedia->priv->screenname, - NULL, gtkmedia->priv->media, - pidgin_media_accept_cb, - pidgin_media_reject_cb); + message, NULL, PURPLE_DEFAULT_ACTION_NONE, + purple_request_cpar_from_account(account), + gtkmedia->priv->media, pidgin_media_accept_cb, + pidgin_media_reject_cb); } pidgin_media_emit_message(gtkmedia, message); g_free(message);
--- a/pidgin/gtkplugin.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkplugin.c Tue Sep 10 21:47:37 2013 +0200 @@ -302,12 +302,11 @@ cb_data[2] = iter; purple_request_action(plugin_dialog, NULL, - _("Multiple plugins will be unloaded."), - tmp->str, 0, - NULL, NULL, NULL, - cb_data, 2, - _("Unload Plugins"), G_CALLBACK(plugin_unload_confirm_cb), - _("Cancel"), g_free); + _("Multiple plugins will be unloaded."), + tmp->str, 0, NULL, cb_data, 2, + _("Unload Plugins"), + G_CALLBACK(plugin_unload_confirm_cb), + _("Cancel"), g_free); g_string_free(tmp, TRUE); } else
--- a/pidgin/gtkpounce.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkpounce.c Tue Sep 10 21:47:37 2013 +0200 @@ -1140,10 +1140,9 @@ buf = g_strdup_printf(_("Are you sure you want to delete the pounce on %s for %s?"), pouncee, pouncer); purple_request_action(pounce, NULL, buf, NULL, 0, - account, pouncee, NULL, - pounce, 2, - _("Delete"), pounces_manager_delete_confirm_cb, - _("Cancel"), NULL); + purple_request_cpar_from_account(account), + pounce, 2, _("Delete"), pounces_manager_delete_confirm_cb, + _("Cancel"), NULL); g_free(buf); }
--- a/pidgin/gtkprivacy.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkprivacy.c Tue Sep 10 21:47:37 2013 +0200 @@ -508,12 +508,11 @@ "%s to contact you?"), name); - purple_request_action(account, _("Permit User"), primary, secondary, - 0, - account, name, NULL, - data, 2, - _("_Permit"), G_CALLBACK(confirm_permit_block_cb), - _("Cancel"), G_CALLBACK(destroy_request_data)); + purple_request_action(account, _("Permit User"), primary, + secondary, 0, purple_request_cpar_from_account(account), + data, 2, + _("_Permit"), G_CALLBACK(confirm_permit_block_cb), + _("Cancel"), G_CALLBACK(destroy_request_data)); g_free(primary); g_free(secondary); @@ -547,12 +546,11 @@ char *secondary = g_strdup_printf(_("Are you sure you want to block %s?"), name); - purple_request_action(account, _("Block User"), primary, secondary, - 0, - account, name, NULL, - data, 2, - _("_Block"), G_CALLBACK(confirm_permit_block_cb), - _("Cancel"), G_CALLBACK(destroy_request_data)); + purple_request_action(account, _("Block User"), primary, + secondary, 0, purple_request_cpar_from_account(account), + data, 2, + _("_Block"), G_CALLBACK(confirm_permit_block_cb), + _("Cancel"), G_CALLBACK(destroy_request_data)); g_free(primary); g_free(secondary);
--- a/pidgin/gtkrequest.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkrequest.c Tue Sep 10 21:47:37 2013 +0200 @@ -579,12 +579,10 @@ } static void * -pidgin_request_action_with_icon(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, gconstpointer icon_data, - gsize icon_size, - void *user_data, size_t action_count, va_list actions) +pidgin_request_action(const char *title, const char *primary, + const char *secondary, int default_action, + PurpleRequestCommonParameters *cpar, void *user_data, + size_t action_count, va_list actions) { PidginRequestData *data; GtkWidget *dialog; @@ -596,6 +594,8 @@ char *label_text; char *primary_esc, *secondary_esc; gsize i; + gconstpointer icon_data; + gsize icon_size; data = g_new0(PidginRequestData, 1); data->type = PURPLE_REQUEST_ACTION; @@ -650,6 +650,7 @@ hbox); /* Dialog icon. */ + icon_data = purple_request_cpar_get_custom_icon(cpar, &icon_size); if (icon_data) { GdkPixbuf *pixbuf = pidgin_pixbuf_from_data(icon_data, icon_size); if (pixbuf) { @@ -688,7 +689,8 @@ vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); - pidgin_widget_decorate_account(hbox, account); + pidgin_widget_decorate_account(hbox, + purple_request_cpar_get_account(cpar)); /* Descriptive label */ primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; @@ -732,17 +734,6 @@ return data; } -static void * -pidgin_request_action(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, PurpleConversation *conv, - void *user_data, size_t action_count, va_list actions) -{ - return pidgin_request_action_with_icon(title, primary, secondary, - default_action, account, who, conv, NULL, 0, user_data, action_count, - actions); -} - static void req_entry_field_changed_cb(GtkWidget *entry, PurpleRequestField *field) { @@ -1618,7 +1609,7 @@ (g_file_test(data->u.file.name, G_FILE_TEST_EXISTS))) { purple_request_action(data, NULL, _("That file already exists"), _("Would you like to overwrite it?"), 0, - NULL, NULL, NULL, + NULL, data, 2, _("Overwrite"), G_CALLBACK(file_yes_no_cb), _("Choose New Name"), G_CALLBACK(file_yes_no_cb)); @@ -1797,7 +1788,7 @@ pidgin_request_file, pidgin_close_request, pidgin_request_folder, - pidgin_request_action_with_icon, + NULL, NULL, NULL, NULL
--- a/pidgin/gtksavedstatuses.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtksavedstatuses.c Tue Sep 10 21:47:37 2013 +0200 @@ -311,7 +311,7 @@ } purple_request_action(handle, NULL, title, NULL, 0, - NULL, NULL, NULL, + NULL, sel_titles, 2, _("Delete"), status_window_delete_confirm_cb, _("Cancel"), status_window_delete_cancel_cb);
--- a/pidgin/gtkstatusbox.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkstatusbox.c Tue Sep 10 21:47:37 2013 +0200 @@ -1600,7 +1600,7 @@ msg = g_strdup_printf(_("Are you sure you want to delete %s?"), purple_savedstatus_get_title(saved)); purple_request_action(saved, NULL, msg, NULL, 0, - NULL, NULL, NULL, + NULL, data, 2, _("Delete"), tree_view_delete_current_selection_cb, _("Cancel"), NULL);
--- a/pidgin/gtkutils.c Tue Sep 10 15:34:10 2013 +0200 +++ b/pidgin/gtkutils.c Tue Sep 10 21:47:37 2013 +0200 @@ -1522,7 +1522,7 @@ purple_request_yes_no(NULL, NULL, _("You have dragged an image"), _("Would you like to set it as the buddy icon for this user?"), PURPLE_DEFAULT_ACTION_NONE, - account, who, NULL, + purple_request_cpar_from_account(account), data, (GCallback)dnd_set_icon_ok_cb, (GCallback)dnd_set_icon_cancel_cb); else purple_request_choice(NULL, NULL,