diff options
author | Tomasz Wasilczyk <twasilczyk@pidgin.im> | 2013-09-21 11:54:03 +0200 |
---|---|---|
committer | Tomasz Wasilczyk <twasilczyk@pidgin.im> | 2013-09-21 11:54:03 +0200 |
commit | 8b1d74a7e246b4408d06d579bd65c180bc8b6b5c (patch) | |
tree | 16bfd9224ae5e65c214952d74713863606a973be | |
parent | 0935e5e2da1d459207a0456785e4e98906c4f9e9 (diff) | |
download | pidgin-8b1d74a7e246b4408d06d579bd65c180bc8b6b5c.tar.gz |
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
93 files changed, 727 insertions, 433 deletions
diff --git a/finch/gntaccount.c b/finch/gntaccount.c index ad683a3a4f..e302955816 100644 --- a/finch/gntaccount.c +++ b/finch/gntaccount.c @@ -126,8 +126,10 @@ save_account_cb(AccountEditDialog *dialog) if (value == NULL || *value == '\0') { purple_notify_error(NULL, _("Error"), - dialog->account ? _("Account was not modified") : _("Account was not added"), - _("Username of an account must be non-empty.")); + dialog->account ? _("Account was not modified") : + _("Account was not added"), + _("Username of an account must be non-empty."), + purple_request_cpar_from_account(dialog->account)); return; } @@ -168,15 +170,25 @@ save_account_cb(AccountEditDialog *dialog) const char *old = purple_account_get_protocol_id(account); char *oldprpl; if (strcmp(old, purple_plugin_get_id(plugin))) { - purple_notify_error(NULL, _("Error"), _("Account was not modified"), - _("The account's protocol cannot be changed while it is connected to the server.")); + purple_notify_error(NULL, _("Error"), + _("Account was not modified"), + _("The account's protocol cannot be " + "changed while it is connected to the " + "server."), + purple_request_cpar_from_account( + account)); return; } oldprpl = g_strdup(purple_normalize(account, purple_account_get_username(account))); if (g_utf8_collate(oldprpl, purple_normalize(account, username->str))) { - purple_notify_error(NULL, _("Error"), _("Account was not modified"), - _("The account's username cannot be changed while it is connected to the server.")); + purple_notify_error(NULL, _("Error"), + _("Account was not modified"), + _("The account's username cannot be " + "changed while it is connected to the " + "server."), + purple_request_cpar_from_account( + account)); g_free(oldprpl); return; } @@ -557,8 +569,9 @@ edit_account_continue(PurpleAccount *account, list = purple_plugins_get_protocols(); if (list == NULL) { purple_notify_error(NULL, _("Error"), - _("There are no protocol plugins installed."), - _("(You probably forgot to 'make install'.)")); + _("There are no protocol plugins installed."), + _("(You probably forgot to 'make install'.)"), + purple_request_cpar_from_account(account)); return; } @@ -966,7 +979,8 @@ notify_added(PurpleAccount *account, const char *remote_user, buffer = make_info(account, gc, remote_user, id, alias, msg); - purple_notify_info(NULL, NULL, buffer, NULL); + purple_notify_info(NULL, NULL, buffer, NULL, + purple_request_cpar_from_connection(gc)); g_free(buffer); } diff --git a/finch/gntblist.c b/finch/gntblist.c index ddf6b301ac..854ce4ceac 100644 --- a/finch/gntblist.c +++ b/finch/gntblist.c @@ -645,7 +645,8 @@ add_buddy_cb(void *data, PurpleRequestFields *allfields) if (error) { finch_request_add_buddy(account, username, group, alias); - purple_notify_error(NULL, _("Error"), _("Error adding buddy"), error); + purple_notify_error(NULL, _("Error"), _("Error adding buddy"), + error, purple_request_cpar_from_account(account)); return; } @@ -815,7 +816,7 @@ add_group_cb(gpointer null, const char *group) if (!group || !*group) { purple_notify_error(NULL, _("Error"), _("Error adding group"), - _("You must give a name for the group to add.")); + _("You must give a name for the group to add."), NULL); return; } diff --git a/finch/gntcertmgr.c b/finch/gntcertmgr.c index 0434e97c8e..13dcfe3a84 100644 --- a/finch/gntcertmgr.c +++ b/finch/gntcertmgr.c @@ -97,7 +97,7 @@ tls_peers_mgmt_import_ok_cb(gpointer data, const char *filename) purple_notify_error(NULL, _("Certificate Import Error"), _("X.509 certificate import failed"), - secondary); + secondary, NULL); g_free(secondary); } } @@ -127,7 +127,7 @@ tls_peers_mgmt_export_ok_cb(gpointer data, const char *filename) purple_notify_error(NULL, _("Certificate Export Error"), _("X.509 certificate export failed"), - secondary); + secondary, NULL); g_free(secondary); } @@ -193,7 +193,7 @@ info_cert_cb(GntWidget *button, gpointer null) secondary = g_strdup_printf(_("Common name: %s\n\nSHA1 fingerprint:\n%s"), subject, fpr_sha1_asc); purple_notify_info(NULL, - _("SSL Host Certificate"), primary, secondary); + _("SSL Host Certificate"), primary, secondary, NULL); g_free(primary); g_free(secondary); diff --git a/finch/gntdebug.c b/finch/gntdebug.c index 34da662153..c8ec315886 100644 --- a/finch/gntdebug.c +++ b/finch/gntdebug.c @@ -273,7 +273,7 @@ file_save(GntFileSel *fs, const char *path, const char *file, GntTextView *tv) FILE *fp; if ((fp = g_fopen(path, "w+")) == NULL) { - purple_notify_error(NULL, NULL, _("Unable to open file."), NULL); + purple_notify_error(NULL, NULL, _("Unable to open file."), NULL, NULL); return; } diff --git a/finch/gntlog.c b/finch/gntlog.c index c946c285c6..23a19cc65b 100644 --- a/finch/gntlog.c +++ b/finch/gntlog.c @@ -289,7 +289,7 @@ static FinchLogViewer *display_log_viewer(struct log_viewer_hash_t *ht, GList *l g_free(ht); } - purple_notify_info(NULL, title, _("No logs were found"), log_preferences); + purple_notify_info(NULL, title, _("No logs were found"), log_preferences, NULL); return NULL; } diff --git a/finch/gntnotify.c b/finch/gntnotify.c index dde80cf711..f9b00a0681 100644 --- a/finch/gntnotify.c +++ b/finch/gntnotify.c @@ -54,7 +54,8 @@ notify_msg_window_destroy_cb(GntWidget *window, PurpleNotifyMsgType type) static void * finch_notify_message(PurpleNotifyMsgType type, const char *title, - const char *primary, const char *secondary) + const char *primary, const char *secondary, + PurpleRequestCommonParameters *cpar) { GntWidget *window, *button; GntTextFormatFlags pf = 0, sf = 0; @@ -156,7 +157,7 @@ static void *finch_notify_formatted(const char *title, const char *primary, void *ret; purple_markup_html_to_xhtml(t, &xhtml, NULL); - ret = finch_notify_message(PURPLE_NOTIFY_FORMATTED, title, primary, xhtml); + ret = finch_notify_message(PURPLE_NOTIFY_FORMATTED, title, primary, xhtml, NULL); g_free(t); g_free(xhtml); @@ -249,7 +250,7 @@ finch_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed, return NULL; } - ret = finch_notify_message(PURPLE_NOTIFY_EMAIL, _("New Mail"), _("You have mail!"), message->str); + ret = finch_notify_message(PURPLE_NOTIFY_EMAIL, _("New Mail"), _("You have mail!"), message->str, NULL); g_string_free(message, TRUE); return ret; } @@ -503,7 +504,7 @@ finch_notify_searchresults(PurpleConnection *gc, const char *title, static void * finch_notify_uri(const char *url) { - return finch_notify_message(PURPLE_NOTIFY_URI, _("URI"), url, NULL); + return finch_notify_message(PURPLE_NOTIFY_URI, _("URI"), url, NULL, NULL); } static PurpleNotifyUiOps ops = diff --git a/finch/gntplugin.c b/finch/gntplugin.c index 549f456c44..0ec21dadaf 100644 --- a/finch/gntplugin.c +++ b/finch/gntplugin.c @@ -83,7 +83,7 @@ plugin_toggled_cb(GntWidget *tree, PurplePlugin *plugin, gpointer null) if (gnt_tree_get_choice(GNT_TREE(tree), plugin)) { if (!purple_plugin_load(plugin)) { - purple_notify_error(NULL, _("ERROR"), _("loading plugin failed"), NULL); + purple_notify_error(NULL, _("ERROR"), _("loading plugin failed"), NULL, NULL); gnt_tree_set_choice(GNT_TREE(tree), plugin, FALSE); } } @@ -92,7 +92,7 @@ plugin_toggled_cb(GntWidget *tree, PurplePlugin *plugin, gpointer null) GntWidget *win; if (!purple_plugin_unload(plugin)) { - purple_notify_error(NULL, _("ERROR"), _("unloading plugin failed"), NULL); + purple_notify_error(NULL, _("ERROR"), _("unloading plugin failed"), NULL, NULL); purple_plugin_disable(plugin); gnt_tree_set_choice(GNT_TREE(tree), plugin, TRUE); } @@ -196,7 +196,7 @@ configure_plugin_cb(GntWidget *button, gpointer null) if (!purple_plugin_is_loaded(plugin)) { purple_notify_error(plugin, _("Error"), - _("Plugin need to be loaded before you can configure it."), NULL); + _("Plugin need to be loaded before you can configure it."), NULL, NULL); return; } @@ -244,7 +244,7 @@ configure_plugin_cb(GntWidget *button, gpointer null) else { purple_notify_info(plugin, _("Error"), - _("No configuration options for this plugin."), NULL); + _("No configuration options for this plugin."), NULL, NULL); return; } } @@ -267,7 +267,7 @@ install_selected_file_cb(gpointer handle, const char *filename) if (!plugin) { purple_notify_error(handle, _("Error loading plugin"), _("The selected file is not a valid plugin."), - _("Please open the debug window and try again to see the exact error message.")); + _("Please open the debug window and try again to see the exact error message."), NULL); return; } if (g_list_find(gnt_tree_get_rows(GNT_TREE(plugins.tree)), plugin)) { diff --git a/finch/gntpounce.c b/finch/gntpounce.c index d5b9ce2b27..6855d874d0 100644 --- a/finch/gntpounce.c +++ b/finch/gntpounce.c @@ -192,7 +192,7 @@ save_pounce_cb(GntWidget *w, PurpleGntPounceDialog *dialog) if (*name == '\0') { purple_notify_error(NULL, NULL, - _("Please enter a buddy to pounce."), NULL); + _("Please enter a buddy to pounce."), NULL, NULL); return; } @@ -631,7 +631,7 @@ pounces_manager_add_cb(GntButton *button, gpointer user_data) if (purple_accounts_get_all() == NULL) { purple_notify_error(NULL, _("Cannot create pounce"), _("You do not have any accounts."), - _("You must create an account first before you can create a pounce.")); + _("You must create an account first before you can create a pounce."), NULL); return; } finch_pounce_editor_show(NULL, NULL, NULL); @@ -853,12 +853,12 @@ pounce_cb(PurplePounce *pounce, PurplePounceEvent events, void *data) if (reason == NULL) { - purple_notify_info(NULL, name_shown, tmp, purple_date_format_full(NULL)); + purple_notify_info(NULL, name_shown, tmp, purple_date_format_full(NULL), NULL); } else { char *tmp2 = g_strdup_printf("%s\n\n%s", reason, purple_date_format_full(NULL)); - purple_notify_info(NULL, name_shown, tmp, tmp2); + purple_notify_info(NULL, name_shown, tmp, tmp2, NULL); g_free(tmp2); } g_free(tmp); diff --git a/finch/gntprefs.c b/finch/gntprefs.c index 824cd33cdf..75123a64d2 100644 --- a/finch/gntprefs.c +++ b/finch/gntprefs.c @@ -298,7 +298,7 @@ void finch_prefs_show_keyring(void) if (fields == NULL) { purple_notify_info(NULL, _("Keyring settings"), _("Selected keyring doesn't allow any configuration"), - NULL); + NULL, NULL); return; } diff --git a/finch/gntrequest.c b/finch/gntrequest.c index af6e297aac..5c971e9ced 100644 --- a/finch/gntrequest.c +++ b/finch/gntrequest.c @@ -391,7 +391,7 @@ request_fields_cb(GntWidget *button, PurpleRequestFields *fields) !purple_request_fields_all_valid(fields))) { purple_notify_error(button, _("Error"), _("You must properly fill all the required fields."), - _("The required fields are underlined.")); + _("The required fields are underlined."), NULL); return; } diff --git a/finch/gntsound.c b/finch/gntsound.c index fee724b0e7..04f5d58c7c 100644 --- a/finch/gntsound.c +++ b/finch/gntsound.c @@ -383,7 +383,7 @@ finch_sound_init(void) if ((gst_init_failed = !gst_init_check(NULL, NULL, &error))) { purple_notify_error(NULL, _("GStreamer Failure"), _("GStreamer failed to initialize."), - error ? error->message : ""); + error ? error->message : "", NULL); if (error) { g_error_free(error); error = NULL; diff --git a/finch/gntstatus.c b/finch/gntstatus.c index 376f142460..0e9dabf35a 100644 --- a/finch/gntstatus.c +++ b/finch/gntstatus.c @@ -300,7 +300,7 @@ save_savedstatus_cb(GntWidget *button, EditStatus *edit) if (!title || !*title) { purple_notify_error(edit, _("Error"), _("Invalid title"), - _("Please enter a non-empty title for the status.")); + _("Please enter a non-empty title for the status."), NULL); gnt_box_give_focus_to_child(GNT_BOX(edit->window), edit->title); return; } @@ -309,7 +309,7 @@ save_savedstatus_cb(GntWidget *button, EditStatus *edit) if (find && find != edit->saved) { purple_notify_error(edit, _("Error"), _("Duplicate title"), - _("Please enter a different title for the status.")); + _("Please enter a different title for the status."), NULL); gnt_box_give_focus_to_child(GNT_BOX(edit->window), edit->title); return; } diff --git a/finch/plugins/gntclipboard.c b/finch/plugins/gntclipboard.c index fea6289cca..06ffc2fa7e 100644 --- a/finch/plugins/gntclipboard.c +++ b/finch/plugins/gntclipboard.c @@ -113,20 +113,20 @@ plugin_load(PurplePlugin *plugin) if (!XOpenDisplay(NULL)) { purple_debug_warning("gntclipboard", "Couldn't find X display\n"); purple_notify_error(NULL, _("Error"), _("Error loading the plugin."), - _("Couldn't find X display")); + _("Couldn't find X display"), NULL); return FALSE; } if (!getenv("WINDOWID")) { purple_debug_warning("gntclipboard", "Couldn't find window\n"); purple_notify_error(NULL, _("Error"), _("Error loading the plugin."), - _("Couldn't find window")); + _("Couldn't find window"), NULL); return FALSE; } sig_handle = g_signal_connect(G_OBJECT(gnt_get_clipboard()), "clipboard_changed", G_CALLBACK(clipboard_changed), NULL); return TRUE; #else purple_notify_error(NULL, _("Error"), _("Error loading the plugin."), - _("This plugin cannot be loaded because it was not built with X11 support.")); + _("This plugin cannot be loaded because it was not built with X11 support."), NULL); return FALSE; #endif } diff --git a/finch/plugins/gnttinyurl.c b/finch/plugins/gnttinyurl.c index 6428279337..bafcd9113a 100644 --- a/finch/plugins/gnttinyurl.c +++ b/finch/plugins/gnttinyurl.c @@ -385,7 +385,7 @@ tinyurl_notify_uri(const char *uri) * may not always happen, e.g. when another plugin sets its own * notify_message. So tread carefully. */ win = purple_notify_message(NULL, PURPLE_NOTIFY_URI, _("URI"), uri, - _("Please wait while TinyURL fetches a shorter URL ..."), NULL, NULL); + _("Please wait while TinyURL fetches a shorter URL ..."), NULL, NULL, NULL); if (!GNT_IS_WINDOW(win) || !g_object_get_data(G_OBJECT(win), "info-widget")) return win; diff --git a/libpurple/account.c b/libpurple/account.c index 40c7247fd8..0562892ba7 100644 --- a/libpurple/account.c +++ b/libpurple/account.c @@ -1218,7 +1218,9 @@ request_password_ok_cb(PurpleAccount *account, PurpleRequestFields *fields) if (!entry || !*entry) { - purple_notify_error(account, NULL, _("Password is required to sign on."), NULL); + purple_notify_error(account, NULL, + _("Password is required to sign on."), NULL, + purple_request_cpar_from_account(account)); return; } @@ -1310,7 +1312,8 @@ purple_account_connect(PurpleAccount *account) gchar *message; message = g_strdup_printf(_("Missing protocol plugin for %s"), username); - purple_notify_error(account, _("Connection Error"), message, NULL); + purple_notify_error(account, _("Connection Error"), message, + NULL, purple_request_cpar_from_account(account)); g_free(message); return; } @@ -1562,7 +1565,8 @@ change_password_cb(PurpleAccount *account, PurpleRequestFields *fields) if (g_utf8_collate(new_pass_1, new_pass_2)) { purple_notify_error(account, NULL, - _("New passwords do not match."), NULL); + _("New passwords do not match."), NULL, + purple_request_cpar_from_account(account)); return; } @@ -1575,7 +1579,8 @@ change_password_cb(PurpleAccount *account, PurpleRequestFields *fields) (new_pass_2 == NULL || *new_pass_2 == '\0'))) { purple_notify_error(account, NULL, - _("Fill out all fields completely."), NULL); + _("Fill out all fields completely."), NULL, + purple_request_cpar_from_account(account)); return; } diff --git a/libpurple/certificate.c b/libpurple/certificate.c index a62aa711ae..961051e1df 100644 --- a/libpurple/certificate.c +++ b/libpurple/certificate.c @@ -1359,7 +1359,7 @@ x509_tls_cached_complete(PurpleCertificateVerificationRequest *vrq, purple_notify_error(NULL, /* TODO: Probably wrong. */ _("SSL Certificate Error"), _("Unable to validate certificate"), - secondary); + secondary, NULL); g_free(secondary); purple_certificate_verify_complete(vrq, flags); diff --git a/libpurple/connection.c b/libpurple/connection.c index 08f97f565b..c4b878348a 100644 --- a/libpurple/connection.c +++ b/libpurple/connection.c @@ -114,7 +114,8 @@ _purple_connection_new(PurpleAccount *account, gboolean regist, const char *pass message = g_strdup_printf(_("Missing protocol plugin for %s"), purple_account_get_username(account)); purple_notify_error(NULL, regist ? _("Registration Error") : - _("Connection Error"), message, NULL); + _("Connection Error"), message, NULL, + purple_request_cpar_from_account(account)); g_free(message); return; } @@ -186,7 +187,8 @@ _purple_connection_new_unregister(PurpleAccount *account, const char *password, message = g_strdup_printf(_("Missing protocol plugin for %s"), purple_account_get_username(account)); - purple_notify_error(NULL, _("Unregistration Error"), message, NULL); + purple_notify_error(NULL, _("Unregistration Error"), message, + NULL, purple_request_cpar_from_account(account)); g_free(message); return; } diff --git a/libpurple/conversation.c b/libpurple/conversation.c index e25b2b79cf..33d76f456a 100644 --- a/libpurple/conversation.c +++ b/libpurple/conversation.c @@ -340,7 +340,9 @@ common_send(PurpleConversation *conv, const char *message, PurpleMessageFlags ms if (!purple_conv_present_error(who, account, msg)) { char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); - purple_notify_error(gc, NULL, msg2, _("The message is too large.")); + purple_notify_error(gc, NULL, msg2, + _("The message is too large."), + purple_request_cpar_from_connection(gc)); g_free(msg2); } } @@ -353,7 +355,8 @@ common_send(PurpleConversation *conv, const char *message, PurpleMessageFlags ms if (!purple_conv_present_error(who, account, msg)) { char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); - purple_notify_error(gc, NULL, msg2, NULL); + purple_notify_error(gc, NULL, msg2, NULL, + purple_request_cpar_from_connection(gc)); g_free(msg2); } } diff --git a/libpurple/dbus-server.h b/libpurple/dbus-server.h index 5810dab8c7..e190cc8cc0 100644 --- a/libpurple/dbus-server.h +++ b/libpurple/dbus-server.h @@ -84,7 +84,7 @@ struct _PurpleDBusType { title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \ purple_notify_error(NULL, title, \ _("Purple's D-BUS server is not running for the reason listed below"), \ - _(purple_dbus_get_init_error())); \ + _(purple_dbus_get_init_error()), NULL); \ g_free(title); \ return FALSE; \ } diff --git a/libpurple/ft.c b/libpurple/ft.c index d28f2f2608..0eb35e3f0e 100644 --- a/libpurple/ft.c +++ b/libpurple/ft.c @@ -391,6 +391,8 @@ purple_xfer_choose_file_ok_cb(void *user_data, const char *filename) purple_notify_message( NULL, PURPLE_NOTIFY_MSG_ERROR, NULL, _("Directory is not writable."), NULL, + purple_request_cpar_from_account( + purple_xfer_get_account(xfer)), (PurpleNotifyCloseCallback)purple_xfer_choose_file, xfer); } @@ -404,7 +406,9 @@ purple_xfer_choose_file_ok_cb(void *user_data, const char *filename) else if ((type == PURPLE_XFER_SEND) && (st.st_size == 0)) { purple_notify_error(NULL, NULL, - _("Cannot send a file of 0 bytes."), NULL); + _("Cannot send a file of 0 bytes."), NULL, + purple_request_cpar_from_account( + purple_xfer_get_account(xfer))); purple_xfer_cancel_local(xfer); } @@ -412,8 +416,9 @@ purple_xfer_choose_file_ok_cb(void *user_data, const char *filename) /* * XXX - Sending a directory should be valid for some protocols. */ - purple_notify_error(NULL, NULL, - _("Cannot send a directory."), NULL); + purple_notify_error(NULL, NULL, _("Cannot send a directory."), + NULL, purple_request_cpar_from_account( + purple_xfer_get_account(xfer))); purple_xfer_cancel_local(xfer); } @@ -423,7 +428,9 @@ purple_xfer_choose_file_ok_cb(void *user_data, const char *filename) msg = g_strdup_printf( _("%s is not a regular file. Cowardly refusing to overwrite it.\n"), utf8); g_free(utf8); - purple_notify_error(NULL, NULL, msg, NULL); + purple_notify_error(NULL, NULL, msg, NULL, + purple_request_cpar_from_account( + purple_xfer_get_account(xfer))); g_free(msg); purple_xfer_request_denied(xfer); } @@ -441,6 +448,8 @@ purple_xfer_choose_file_ok_cb(void *user_data, const char *filename) purple_notify_message( NULL, PURPLE_NOTIFY_MSG_ERROR, NULL, _("File is not readable."), NULL, + purple_request_cpar_from_account( + purple_xfer_get_account(xfer)), (PurpleNotifyCloseCallback)purple_xfer_choose_file, xfer); } } @@ -1739,7 +1748,8 @@ purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, else title = g_strdup_printf(_("File transfer from %s failed."), who); - purple_notify_error(NULL, NULL, title, msg); + purple_notify_error(NULL, NULL, title, msg, + purple_request_cpar_from_account(account)); g_free(title); } diff --git a/libpurple/keyring.c b/libpurple/keyring.c index 5ab9b425a8..2395d76f82 100644 --- a/libpurple/keyring.c +++ b/libpurple/keyring.c @@ -868,7 +868,7 @@ purple_keyring_set_password_save_cb(PurpleAccount *account, GError *error, if (error != NULL) { purple_notify_error(NULL, _("Keyrings"), _("Failed to save a password in keyring."), - error->message); + error->message, NULL); } if (set_data->cb != NULL) @@ -1204,7 +1204,7 @@ static void purple_keyring_core_initialized_cb(void) purple_notify_error(NULL, _("Keyrings"), _("Failed to load selected keyring."), _("Check your system configuration or select another " - "one in Preferences dialog.")); + "one in Preferences dialog."), NULL); } } diff --git a/libpurple/notify.c b/libpurple/notify.c index 7d94b5da2e..0c3f09a454 100644 --- a/libpurple/notify.c +++ b/libpurple/notify.c @@ -67,9 +67,10 @@ struct _PurpleNotifySearchColumn }; void * -purple_notify_message(void *handle, PurpleNotifyMsgType type, - const char *title, const char *primary, - const char *secondary, PurpleNotifyCloseCallback cb, gpointer user_data) +purple_notify_message(void *handle, PurpleNotifyMsgType type, const char *title, + const char *primary, const char *secondary, + PurpleRequestCommonParameters *cpar, PurpleNotifyCloseCallback cb, + gpointer user_data) { PurpleNotifyUiOps *ops; @@ -79,7 +80,7 @@ purple_notify_message(void *handle, PurpleNotifyMsgType type, if (ops != NULL && ops->notify_message != NULL) { void *ui_handle = ops->notify_message(type, title, primary, - secondary); + secondary, cpar); if (ui_handle != NULL) { PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1); diff --git a/libpurple/notify.h b/libpurple/notify.h index ea7ab2b7c5..b81216cc7c 100644 --- a/libpurple/notify.h +++ b/libpurple/notify.h @@ -37,6 +37,7 @@ typedef struct _PurpleNotifyUserInfo PurpleNotifyUserInfo; typedef struct _PurpleNotifySearchColumn PurpleNotifySearchColumn; #include "connection.h" +#include "request.h" /** @@ -139,7 +140,8 @@ typedef struct typedef struct { void *(*notify_message)(PurpleNotifyMsgType type, const char *title, - const char *primary, const char *secondary); + const char *primary, const char *secondary, + PurpleRequestCommonParameters *cpar); void *(*notify_email)(PurpleConnection *gc, const char *subject, const char *from, @@ -327,6 +329,8 @@ void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results, * @param title The title of the message. * @param primary The main point of the message. * @param secondary The secondary information. + * @param cpar The #PurpleRequestCommonParameters associated with this + * request, or @c NULL if none is. * @param cb The callback to call when the user closes * the notification. * @param user_data The data to pass to the callback. @@ -334,9 +338,9 @@ void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results, * @return A UI-specific handle. */ void *purple_notify_message(void *handle, PurpleNotifyMsgType type, - const char *title, const char *primary, - const char *secondary, PurpleNotifyCloseCallback cb, - gpointer user_data); + const char *title, const char *primary, const char *secondary, + PurpleRequestCommonParameters *cpar, PurpleNotifyCloseCallback cb, + gpointer user_data); /** * Displays a single email notification to the user. @@ -664,23 +668,23 @@ void purple_notify_close_with_handle(void *handle); /** * A wrapper for purple_notify_message that displays an information message. */ -#define purple_notify_info(handle, title, primary, secondary) \ +#define purple_notify_info(handle, title, primary, secondary, cpar) \ purple_notify_message((handle), PURPLE_NOTIFY_MSG_INFO, (title), \ - (primary), (secondary), NULL, NULL) + (primary), (secondary), (cpar), NULL, NULL) /** * A wrapper for purple_notify_message that displays a warning message. */ -#define purple_notify_warning(handle, title, primary, secondary) \ +#define purple_notify_warning(handle, title, primary, secondary, cpar) \ purple_notify_message((handle), PURPLE_NOTIFY_MSG_WARNING, (title), \ - (primary), (secondary), NULL, NULL) + (primary), (secondary), (cpar), NULL, NULL) /** * A wrapper for purple_notify_message that displays an error message. */ -#define purple_notify_error(handle, title, primary, secondary) \ +#define purple_notify_error(handle, title, primary, secondary, cpar) \ purple_notify_message((handle), PURPLE_NOTIFY_MSG_ERROR, (title), \ - (primary), (secondary), NULL, NULL) + (primary), (secondary), (cpar), NULL, NULL) /*@}*/ diff --git a/libpurple/plugin.c b/libpurple/plugin.c index 1f92c4b34a..62c7b44ccd 100644 --- a/libpurple/plugin.c +++ b/libpurple/plugin.c @@ -532,7 +532,7 @@ purple_plugin_load(PurplePlugin *plugin) dep_name); purple_notify_error(NULL, NULL, - _("Unable to load the plugin"), tmp); + _("Unable to load the plugin"), tmp, NULL); g_free(tmp); g_list_free(dep_list); @@ -558,7 +558,7 @@ purple_plugin_load(PurplePlugin *plugin) plugin->info->name); purple_notify_error(NULL, NULL, - _("Unable to load your plugin."), tmp); + _("Unable to load your plugin."), tmp, NULL); g_free(tmp); g_list_free(dep_list); diff --git a/libpurple/plugins/autoaccept.c b/libpurple/plugins/autoaccept.c index 22db21e76c..7e7dee8c9a 100644 --- a/libpurple/plugins/autoaccept.c +++ b/libpurple/plugins/autoaccept.c @@ -77,7 +77,9 @@ auto_accept_complete_cb(PurpleXfer *xfer, PurpleXfer *my) { char *message = g_strdup_printf(_("Autoaccepted file transfer of \"%s\" from \"%s\" completed."), purple_xfer_get_filename(xfer), purple_xfer_get_remote_user(xfer)); - purple_notify_info(NULL, _("Autoaccept complete"), message, NULL); + purple_notify_info(NULL, _("Autoaccept complete"), message, + NULL, purple_request_cpar_from_account( + purple_xfer_get_account(xfer))); g_free(message); } } diff --git a/libpurple/plugins/helloworld.c b/libpurple/plugins/helloworld.c index 7bb2b1105b..a3426c5434 100644 --- a/libpurple/plugins/helloworld.c +++ b/libpurple/plugins/helloworld.c @@ -60,7 +60,7 @@ plugin_action_test_cb (PurplePluginAction * action) { purple_notify_message (helloworld_plugin, PURPLE_NOTIFY_MSG_INFO, "Plugin Actions Test", "This is a plugin actions test :)", NULL, NULL, - NULL); + NULL, NULL); } /* we tell libpurple in the PurplePluginInfo struct to call this function to @@ -93,7 +93,7 @@ plugin_load (PurplePlugin * plugin) { purple_notify_message (plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!", "This is the Hello World! plugin :)", NULL, NULL, - NULL); + NULL, NULL); helloworld_plugin = plugin; /* assign this here so we have a valid handle later */ diff --git a/libpurple/plugins/idle.c b/libpurple/plugins/idle.c index 57d22c77a3..3c1c0ff3da 100644 --- a/libpurple/plugins/idle.c +++ b/libpurple/plugins/idle.c @@ -176,7 +176,7 @@ unidle_action(PurplePluginAction *action) if (idled_accts == NULL) { - purple_notify_info(NULL, NULL, _("None of your accounts are idle."), NULL); + purple_notify_info(NULL, NULL, _("None of your accounts are idle."), NULL, NULL); return; } diff --git a/libpurple/plugins/keyrings/internalkeyring.c b/libpurple/plugins/keyrings/internalkeyring.c index 25a381317b..8f2bf90025 100644 --- a/libpurple/plugins/keyrings/internalkeyring.c +++ b/libpurple/plugins/keyrings/internalkeyring.c @@ -526,7 +526,8 @@ intkeyring_unlock_ok(gpointer _unused, _("Unlocking internal keyring"), _("Selected encryption method is not supported."), _("Most probably, your passwords were encrypted with " - "newer Pidgin/libpurple version, please update.")); + "newer Pidgin/libpurple version, please update."), + NULL); return; } @@ -904,7 +905,7 @@ intkeyring_apply_settings(void *notify_handle, if (g_strcmp0(passphrase, passphrase2) != 0) { purple_notify_error(notify_handle, _("Internal keyring settings"), - _("Passphrases do not match"), NULL); + _("Passphrases do not match"), NULL, NULL); return FALSE; } @@ -914,7 +915,7 @@ intkeyring_apply_settings(void *notify_handle, purple_notify_error(notify_handle, _("Internal keyring settings"), _("You have to set up a Master password, if you want " - "to enable encryption"), NULL); + "to enable encryption"), NULL, NULL); return FALSE; } @@ -924,7 +925,7 @@ intkeyring_apply_settings(void *notify_handle, purple_notify_error(notify_handle, _("Internal keyring settings"), _("You don't need any master password, if you won't " - "enable passwords encryption"), NULL); + "enable passwords encryption"), NULL, NULL); return FALSE; } diff --git a/libpurple/plugins/notify_example.c b/libpurple/plugins/notify_example.c index ee918a463d..639b85fb9f 100644 --- a/libpurple/plugins/notify_example.c +++ b/libpurple/plugins/notify_example.c @@ -58,21 +58,21 @@ static void notify_error_cb(PurplePluginAction *action) { purple_notify_error(notify_example, "Test Notification", "Test Notification", - "This is a test error notification"); + "This is a test error notification", NULL); } static void notify_info_cb(PurplePluginAction *action) { purple_notify_info(notify_example, "Test Notification", "Test Notification", - "This is a test informative notification"); + "This is a test informative notification", NULL); } static void notify_warn_cb(PurplePluginAction *action) { purple_notify_warning(notify_example, "Test Notification", "Test Notification", - "This is a test warning notification"); + "This is a test warning notification", NULL); } static void diff --git a/libpurple/plugins/perl/common/Notify.xs b/libpurple/plugins/perl/common/Notify.xs index 1ec708e9dc..5bac54fb4b 100644 --- a/libpurple/plugins/perl/common/Notify.xs +++ b/libpurple/plugins/perl/common/Notify.xs @@ -102,6 +102,10 @@ purple_notify_message(handle, type, title, primary, secondary, cb, user_data) const char *secondary Purple::NotifyCloseCallback cb gpointer user_data +CODE: + RETVAL = purple_notify_message(handle, type, title, primary, secondary, NULL, cb, user_data); +OUTPUT: + RETVAL void * purple_notify_searchresults(gc, title, primary, secondary, results, cb, user_data) diff --git a/libpurple/plugins/tcl/tcl_cmds.c b/libpurple/plugins/tcl/tcl_cmds.c index 04ed4a3b7c..6d04cba635 100644 --- a/libpurple/plugins/tcl/tcl_cmds.c +++ b/libpurple/plugins/tcl/tcl_cmds.c @@ -1009,7 +1009,7 @@ int tcl_cmd_notify(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CON msg2 = Tcl_GetString(objv[4]); } - purple_notify_message(_tcl_plugin, optind[type], title, msg1, msg2, NULL, NULL); + purple_notify_message(_tcl_plugin, optind[type], title, msg1, msg2, NULL, NULL, NULL); return TCL_OK; } diff --git a/libpurple/protocols/gg/account.c b/libpurple/protocols/gg/account.c index 646b47d62e..bbf27f3730 100644 --- a/libpurple/protocols/gg/account.c +++ b/libpurple/protocols/gg/account.c @@ -125,7 +125,8 @@ static void ggp_account_token_response(struct gg_http *h, gboolean success, purple_notify_error( purple_connection_get_account(reqdata->gc), _("Token Error"), - _("Unable to fetch the token."), NULL); + _("Unable to fetch the token."), NULL, + purple_request_cpar_from_connection(reqdata->gc)); } reqdata->callback(reqdata->gc, token, reqdata->user_data); @@ -347,7 +348,8 @@ static void ggp_account_register_response(struct gg_http *h, gboolean success, purple_notify_error(NULL, GGP_ACCOUNT_REGISTER_TITLE, _("Unable to register new account. " - "An unknown error occurred."), NULL); + "An unknown error occurred."), NULL, + purple_request_cpar_from_account(account)); ggp_account_register_completed(register_data, FALSE); return; } @@ -364,7 +366,8 @@ static void ggp_account_register_response(struct gg_http *h, gboolean success, tmp = g_strdup_printf(_("Your new GG number: %u."), uin); purple_notify_info(account, GGP_ACCOUNT_REGISTER_TITLE, - _("Registration completed successfully!"), tmp); + _("Registration completed successfully!"), tmp, + purple_request_cpar_from_account(account)); g_free(tmp); ggp_account_register_completed(register_data, TRUE); @@ -595,7 +598,8 @@ static void ggp_account_chpass_dialog_invalid( ggp_account_chpass_dialog(chpass_data->gc, chpass_data->token, chpass_data); purple_notify_error(purple_connection_get_account(chpass_data->gc), - GGP_ACCOUNT_CHPASS_TITLE, message, NULL); + GGP_ACCOUNT_CHPASS_TITLE, message, NULL, + purple_request_cpar_from_connection(chpass_data->gc)); } static void ggp_account_chpass_dialog_cancel( @@ -629,7 +633,8 @@ static void ggp_account_chpass_response(struct gg_http *h, gboolean success, purple_notify_error(NULL, GGP_ACCOUNT_CHPASS_TITLE, _("Unable to change password. " - "An unknown error occurred."), NULL); + "An unknown error occurred."), NULL, + purple_request_cpar_from_connection(chpass_data->gc)); ggp_account_chpass_data_free(chpass_data); return; } @@ -641,7 +646,8 @@ static void ggp_account_chpass_response(struct gg_http *h, gboolean success, NULL, NULL); purple_notify_info(account, GGP_ACCOUNT_CHPASS_TITLE, - _("Your password has been changed."), NULL); + _("Your password has been changed."), NULL, + purple_request_cpar_from_connection(chpass_data->gc)); ggp_account_chpass_data_free(chpass_data); diff --git a/libpurple/protocols/gg/deprecated.c b/libpurple/protocols/gg/deprecated.c index 0eea818c22..7c79f6a7a1 100644 --- a/libpurple/protocols/gg/deprecated.c +++ b/libpurple/protocols/gg/deprecated.c @@ -41,7 +41,9 @@ gboolean ggp_deprecated_setup_proxy(PurpleConnection *gc) { gg_proxy_enabled = 0; purple_notify_error(NULL, NULL, _("Invalid proxy settings"), - _("Either the host name or port number specified for your given proxy type is invalid.")); + _("Either the host name or port number specified for " + "your given proxy type is invalid."), + purple_request_cpar_from_connection(gc)); return FALSE; } diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c index e17e780318..86ebca2ed2 100644 --- a/libpurple/protocols/gg/gg.c +++ b/libpurple/protocols/gg/gg.c @@ -95,7 +95,8 @@ const gchar * ggp_get_imtoken(PurpleConnection *gc) purple_notify_error(gc, _("Authentication failed"), _("IMToken value has not been received."), _("Some features will be disabled. " - "You may try again after a while.")); + "You may try again after a while."), + purple_request_cpar_from_connection(gc)); return NULL; } @@ -118,21 +119,22 @@ static void ggp_callback_buddylist_save_ok(PurpleConnection *gc, const char *fil purple_debug_info("gg", "file = %s\n", filename); if (buddylist == NULL) { - purple_notify_info(account, _("Save Buddylist..."), - _("Your buddylist is empty, nothing was written to the file."), - NULL); + purple_notify_info(account, _("Save Buddylist..."), _("Your " + "buddylist is empty, nothing was written to the file."), + NULL, purple_request_cpar_from_connection(gc)); return; } if(purple_util_write_data_to_file_absolute(filename, buddylist, -1)) { purple_notify_info(account, _("Save Buddylist..."), - _("Buddylist saved successfully!"), NULL); + _("Buddylist saved successfully!"), NULL, + purple_request_cpar_from_connection(gc)); } else { gchar *primary = g_strdup_printf( _("Couldn't write buddy list for %s to %s"), purple_account_get_username(account), filename); purple_notify_error(account, _("Save Buddylist..."), - primary, NULL); + primary, NULL, purple_request_cpar_from_connection(gc)); g_free(primary); } @@ -149,10 +151,9 @@ static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file) purple_debug_info("gg", "file_name = %s\n", file); if (!g_file_get_contents(file, &buddylist, &length, &error)) { - purple_notify_error(account, - _("Couldn't load buddylist"), - _("Couldn't load buddylist"), - error->message); + purple_notify_error(account, _("Couldn't load buddylist"), + _("Couldn't load buddylist"), error->message, + purple_request_cpar_from_connection(gc)); purple_debug_error("gg", "Couldn't load buddylist. file = %s; error = %s\n", @@ -166,9 +167,9 @@ static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file) ggp_buddylist_load(gc, buddylist); g_free(buddylist); - purple_notify_info(account, - _("Load Buddylist..."), - _("Buddylist loaded successfully!"), NULL); + purple_notify_info(account, _("Load Buddylist..."), + _("Buddylist loaded successfully!"), NULL, + purple_request_cpar_from_connection(gc)); } /* }}} */ diff --git a/libpurple/protocols/gg/pubdir-prpl.c b/libpurple/protocols/gg/pubdir-prpl.c index 1d15f804f7..ae4834fae2 100644 --- a/libpurple/protocols/gg/pubdir-prpl.c +++ b/libpurple/protocols/gg/pubdir-prpl.c @@ -671,7 +671,8 @@ static void ggp_pubdir_search_results_display(PurpleConnection *gc, (records_count == 0 && form->offset != 0)) { purple_notify_error(gc, GGP_PUBDIR_SEARCH_TITLE, - _("Error while searching for buddies"), NULL); + _("Error while searching for buddies"), NULL, + purple_request_cpar_from_connection(gc)); ggp_pubdir_search_form_free(form); return; } @@ -680,7 +681,8 @@ static void ggp_pubdir_search_results_display(PurpleConnection *gc, { purple_notify_info(gc, GGP_PUBDIR_SEARCH_TITLE, _("No matching users found"), - _("There are no users matching your search criteria.")); + _("There are no users matching your search criteria."), + purple_request_cpar_from_connection(gc)); ggp_pubdir_search_form_free(form); return; } diff --git a/libpurple/protocols/irc/dcc_send.c b/libpurple/protocols/irc/dcc_send.c index 132bfceef9..dcb9ee7b7c 100644 --- a/libpurple/protocols/irc/dcc_send.c +++ b/libpurple/protocols/irc/dcc_send.c @@ -303,7 +303,8 @@ irc_dccsend_network_listen_cb(int sock, gpointer data) if (sock < 0) { purple_notify_error(gc, NULL, _("File Transfer Failed"), - _("Unable to open a listening port.")); + _("Unable to open a listening port."), + purple_request_cpar_from_connection(gc)); purple_xfer_cancel_local(xfer); return; } @@ -344,7 +345,8 @@ static void irc_dccsend_send_init(PurpleXfer *xfer) { if (xd->listen_data == NULL) { purple_xfer_unref(xfer); purple_notify_error(gc, NULL, _("File Transfer Failed"), - _("Unable to open a listening port.")); + _("Unable to open a listening port."), + purple_request_cpar_from_connection(gc)); purple_xfer_cancel_local(xfer); } diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c index 88445a1935..c5592f9db6 100644 --- a/libpurple/protocols/irc/irc.c +++ b/libpurple/protocols/irc/irc.c @@ -74,8 +74,10 @@ static void irc_view_motd(PurplePluginAction *action) } irc = purple_connection_get_protocol_data(gc); if (irc->motd == NULL) { - purple_notify_error(gc, _("Error displaying MOTD"), _("No MOTD available"), - _("There is no MOTD associated with this connection.")); + purple_notify_error(gc, _("Error displaying MOTD"), + _("No MOTD available"), + _("There is no MOTD associated with this connection."), + purple_request_cpar_from_connection(gc)); return; } title = g_strdup_printf(_("MOTD for %s"), irc->server); diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c index d6e11cb51a..56d1003893 100644 --- a/libpurple/protocols/irc/msgs.c +++ b/libpurple/protocols/irc/msgs.c @@ -262,7 +262,8 @@ void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, c if (!args || !args[1] || !gc) return; - purple_notify_error(gc, NULL, _("Bad mode"), args[1]); + purple_notify_error(gc, NULL, _("Bad mode"), args[1], + purple_request_cpar_from_connection(gc)); } void irc_msg_ban(struct irc_conn *irc, const char *name, const char *from, char **args) @@ -319,7 +320,8 @@ void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, ch return; buf = g_strdup_printf(_("You are banned from %s."), args[1]); - purple_notify_error(gc, _("Banned"), _("Banned"), buf); + purple_notify_error(gc, _("Banned"), _("Banned"), buf, + purple_request_cpar_from_connection(gc)); g_free(buf); } @@ -683,7 +685,9 @@ void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, c return; buf = g_strdup_printf(_("Unknown message '%s'"), args[1]); - purple_notify_error(gc, _("Unknown message"), buf, _("The IRC server received a message it did not understand.")); + purple_notify_error(gc, _("Unknown message"), buf, _("The IRC server " + "received a message it did not understand."), + purple_request_cpar_from_connection(gc)); g_free(buf); } @@ -818,8 +822,8 @@ void irc_msg_time(struct irc_conn *irc, const char *name, const char *from, char return; purple_notify_message(gc, PURPLE_NOTIFY_MSG_INFO, _("Time Response"), - _("The IRC server's local time is:"), - args[2], NULL, NULL); + _("The IRC server's local time is:"), args[2], NULL, NULL, + purple_request_cpar_from_connection(gc)); } void irc_msg_nochan(struct irc_conn *irc, const char *name, const char *from, char **args) @@ -829,7 +833,8 @@ void irc_msg_nochan(struct irc_conn *irc, const char *name, const char *from, ch if (gc == NULL || args == NULL || args[1] == NULL) return; - purple_notify_error(gc, NULL, _("No such channel"), args[1]); + purple_notify_error(gc, NULL, _("No such channel"), args[1], + purple_request_cpar_from_connection(gc)); } void irc_msg_nonick(struct irc_conn *irc, const char *name, const char *from, char **args) @@ -848,7 +853,8 @@ void irc_msg_nonick(struct irc_conn *irc, const char *name, const char *from, ch } else { if ((gc = purple_account_get_connection(irc->account)) == NULL) return; - purple_notify_error(gc, NULL, _("No such nick or channel"), args[1]); + purple_notify_error(gc, NULL, _("No such nick or channel"), + args[1], purple_request_cpar_from_connection(gc)); } if (irc->whois.nick && !purple_utf8_strcasecmp(irc->whois.nick, args[1])) { @@ -868,7 +874,8 @@ void irc_msg_nosend(struct irc_conn *irc, const char *name, const char *from, ch } else { if ((gc = purple_account_get_connection(irc->account)) == NULL) return; - purple_notify_error(gc, NULL, _("Could not send"), args[2]); + purple_notify_error(gc, NULL, _("Could not send"), args[2], + purple_request_cpar_from_connection(gc)); } } @@ -925,7 +932,8 @@ void irc_msg_inviteonly(struct irc_conn *irc, const char *name, const char *from return; buf = g_strdup_printf(_("Joining %s requires an invitation."), args[1]); - purple_notify_error(gc, _("Invitation only"), _("Invitation only"), buf); + purple_notify_error(gc, _("Invitation only"), _("Invitation only"), buf, + purple_request_cpar_from_connection(gc)); g_free(buf); } @@ -1177,9 +1185,10 @@ void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, c { PurpleConnection *gc = purple_account_get_connection(irc->account); if (purple_connection_get_state(gc) == PURPLE_CONNECTED) { - purple_notify_error(gc, _("Invalid nickname"), - _("Invalid nickname"), - _("Your selected nickname was rejected by the server. It probably contains invalid characters.")); + purple_notify_error(gc, _("Invalid nickname"), _("Invalid " + "nickname"), _("Your selected nickname was rejected by " + "the server. It probably contains invalid characters."), + purple_request_cpar_from_connection(gc)); } else { purple_connection_error (gc, @@ -1202,8 +1211,8 @@ void irc_msg_nickused(struct irc_conn *irc, const char *name, const char *from, notify the user that their /nick command didn't go. */ buf = g_strdup_printf(_("The nickname \"%s\" is already being used."), irc->reqnick); - purple_notify_error(gc, _("Nickname in use"), - _("Nickname in use"), buf); + purple_notify_error(gc, _("Nickname in use"), _("Nickname in " + "use"), buf, purple_request_cpar_from_connection(gc)); g_free(buf); g_free(irc->reqnick); irc->reqnick = NULL; @@ -1247,7 +1256,9 @@ void irc_msg_nochangenick(struct irc_conn *irc, const char *name, const char *fr if (!args || !args[2] || !gc) return; - purple_notify_error(gc, _("Cannot change nick"), _("Could not change nick"), args[2]); + purple_notify_error(gc, _("Cannot change nick"), + _("Could not change nick"), args[2], + purple_request_cpar_from_connection(gc)); } void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args) @@ -1334,7 +1345,8 @@ void irc_msg_pong(struct irc_conn *irc, const char *name, const char *from, char g_free(msg); return; } - purple_notify_info(gc, NULL, "PONG", msg); + purple_notify_info(gc, NULL, "PONG", msg, + purple_request_cpar_from_connection(gc)); } g_free(msg); } @@ -1410,7 +1422,8 @@ void irc_msg_regonly(struct irc_conn *irc, const char *name, const char *from, c } msg = g_strdup_printf(_("Cannot join %s: Registration is required."), args[1]); - purple_notify_error(gc, _("Cannot join channel"), msg, args[2]); + purple_notify_error(gc, _("Cannot join channel"), msg, args[2], + purple_request_cpar_from_connection(gc)); g_free(msg); } @@ -1444,7 +1457,9 @@ void irc_msg_unavailable(struct irc_conn *irc, const char *name, const char *fro if (!args || !args[1]) return; - purple_notify_error(gc, NULL, _("Nick or channel is temporarily unavailable."), args[1]); + purple_notify_error(gc, NULL, _("Nick or channel is temporarily " + "unavailable."), args[1], + purple_request_cpar_from_connection(gc)); } void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args) @@ -1458,7 +1473,8 @@ void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, c nick = irc_mask_nick(from); msg = g_strdup_printf (_("Wallops from %s"), nick); g_free(nick); - purple_notify_info(gc, NULL, msg, args[0]); + purple_notify_info(gc, NULL, msg, args[0], + purple_request_cpar_from_connection(gc)); g_free(msg); } diff --git a/libpurple/protocols/irc/parse.c b/libpurple/protocols/irc/parse.c index 5fb5980f24..e59c130c07 100644 --- a/libpurple/protocols/irc/parse.c +++ b/libpurple/protocols/irc/parse.c @@ -565,7 +565,9 @@ char *irc_parse_ctcp(struct irc_conn *irc, const char *from, const char *to, con /* TODO: Should this read in the timestamp as a double? */ if (sscanf(cur, "PING %lu", ×tamp) == 1) { buf = g_strdup_printf(_("Reply time from %s: %lu seconds"), from, time(NULL) - timestamp); - purple_notify_info(gc, _("PONG"), _("CTCP PING reply"), buf); + purple_notify_info(gc, _("PONG"), + _("CTCP PING reply"), buf, + purple_request_cpar_from_connection(gc)); g_free(buf); } else purple_debug(PURPLE_DEBUG_ERROR, "irc", "Unable to parse PING timestamp"); diff --git a/libpurple/protocols/jabber/adhoccommands.c b/libpurple/protocols/jabber/adhoccommands.c index 60dc73305d..53ffb0e363 100644 --- a/libpurple/protocols/jabber/adhoccommands.c +++ b/libpurple/protocols/jabber/adhoccommands.c @@ -161,7 +161,8 @@ jabber_adhoc_parse(JabberStream *js, const char *from, msg = g_strdup(_("Unknown Error")); purple_notify_error(NULL, _("Ad-Hoc Command Failed"), - _("Ad-Hoc Command Failed"), msg); + _("Ad-Hoc Command Failed"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); return; } @@ -175,7 +176,8 @@ jabber_adhoc_parse(JabberStream *js, const char *from, if(note) { char *data = xmlnode_get_data(note); - purple_notify_info(NULL, from, data, NULL); + purple_notify_info(NULL, from, data, NULL, + purple_request_cpar_from_connection(js->gc)); g_free(data); } diff --git a/libpurple/protocols/jabber/buddy.c b/libpurple/protocols/jabber/buddy.c index 3d0c8ba09e..e0ab0edaa5 100644 --- a/libpurple/protocols/jabber/buddy.c +++ b/libpurple/protocols/jabber/buddy.c @@ -2161,7 +2161,8 @@ static void user_search_fields_result_cb(JabberStream *js, const char *from, msg = g_strdup(_("Unknown error")); purple_notify_error(js->gc, _("Directory Query Failed"), - _("Could not query the directory server."), msg); + _("Could not query the directory server."), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); return; @@ -2248,7 +2249,9 @@ void jabber_user_search(JabberStream *js, const char *directory) /* XXX: should probably better validate the directory we're given */ if(!directory || !*directory) { - purple_notify_error(js->gc, _("Invalid Directory"), _("Invalid Directory"), NULL); + purple_notify_error(js->gc, _("Invalid Directory"), + _("Invalid Directory"), NULL, + purple_request_cpar_from_connection(js->gc)); return; } diff --git a/libpurple/protocols/jabber/chat.c b/libpurple/protocols/jabber/chat.c index 2b92e32d5b..1818636dc5 100644 --- a/libpurple/protocols/jabber/chat.c +++ b/libpurple/protocols/jabber/chat.c @@ -377,21 +377,23 @@ void jabber_chat_join(PurpleConnection *gc, GHashTable *data) if(!jabber_nodeprep_validate(room)) { char *buf = g_strdup_printf(_("%s is not a valid room name"), room); purple_notify_error(gc, _("Invalid Room Name"), _("Invalid Room Name"), - buf); + buf, purple_request_cpar_from_connection(gc)); purple_serv_got_join_chat_failed(gc, data); g_free(buf); return; } else if(!jabber_domain_validate(server)) { char *buf = g_strdup_printf(_("%s is not a valid server name"), server); purple_notify_error(gc, _("Invalid Server Name"), - _("Invalid Server Name"), buf); + _("Invalid Server Name"), buf, + purple_request_cpar_from_connection(gc)); purple_serv_got_join_chat_failed(gc, data); g_free(buf); return; } else if(!jabber_resourceprep_validate(handle)) { char *buf = g_strdup_printf(_("%s is not a valid room handle"), handle); purple_notify_error(gc, _("Invalid Room Handle"), - _("Invalid Room Handle"), buf); + _("Invalid Room Handle"), buf, + purple_request_cpar_from_connection(gc)); purple_serv_got_join_chat_failed(gc, data); g_free(buf); return; @@ -534,7 +536,9 @@ static void jabber_chat_room_configure_cb(JabberStream *js, const char *from, } else if (type == JABBER_IQ_ERROR) { char *msg = jabber_parse_error(js, packet, NULL); - purple_notify_error(js->gc, _("Configuration error"), _("Configuration error"), msg); + purple_notify_error(js->gc, _("Configuration error"), + _("Configuration error"), msg, + purple_request_cpar_from_connection(js->gc)); if(msg) g_free(msg); @@ -543,7 +547,9 @@ static void jabber_chat_room_configure_cb(JabberStream *js, const char *from, msg = g_strdup_printf("Unable to configure room %s", from); - purple_notify_info(js->gc, _("Unable to configure"), _("Unable to configure"), msg); + purple_notify_info(js->gc, _("Unable to configure"), + _("Unable to configure"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); } @@ -558,8 +564,10 @@ void jabber_chat_request_room_configure(JabberChat *chat) { chat->config_dialog_handle = NULL; if(!chat->muc) { - purple_notify_error(chat->js->gc, _("Room Configuration Error"), _("Room Configuration Error"), - _("This room is not capable of being configured")); + purple_notify_error(chat->js->gc, _("Room Configuration Error"), + _("Room Configuration Error"), + _("This room is not capable of being configured"), + purple_request_cpar_from_connection(chat->js->gc)); return; } @@ -609,7 +617,9 @@ jabber_chat_register_x_data_result_cb(JabberStream *js, const char *from, if (type == JABBER_IQ_ERROR) { char *msg = jabber_parse_error(js, packet, NULL); - purple_notify_error(js->gc, _("Registration error"), _("Registration error"), msg); + purple_notify_error(js->gc, _("Registration error"), + _("Registration error"), msg, + purple_request_cpar_from_connection(js->gc)); if(msg) g_free(msg); @@ -678,7 +688,9 @@ static void jabber_chat_register_cb(JabberStream *js, const char *from, } else if (type == JABBER_IQ_ERROR) { char *msg = jabber_parse_error(js, packet, NULL); - purple_notify_error(js->gc, _("Registration error"), _("Registration error"), msg); + purple_notify_error(js->gc, _("Registration error"), + _("Registration error"), msg, + purple_request_cpar_from_connection(js->gc)); if(msg) g_free(msg); @@ -687,7 +699,8 @@ static void jabber_chat_register_cb(JabberStream *js, const char *from, msg = g_strdup_printf("Unable to configure room %s", from); - purple_notify_info(js->gc, _("Unable to configure"), _("Unable to configure"), msg); + purple_notify_info(js->gc, _("Unable to configure"), _("Unable to " + "configure"), msg, purple_request_cpar_from_connection(js->gc)); g_free(msg); } @@ -809,7 +822,8 @@ static void roomlist_disco_result_cb(JabberStream *js, const char *from, if (type == JABBER_IQ_ERROR) { char *err = jabber_parse_error(js, packet, NULL); purple_notify_error(js->gc, _("Error"), - _("Error retrieving room list"), err); + _("Error retrieving room list"), err, + purple_request_cpar_from_connection(js->gc)); purple_roomlist_set_in_progress(js->roomlist, FALSE); purple_roomlist_unref(js->roomlist); js->roomlist = NULL; @@ -820,7 +834,8 @@ static void roomlist_disco_result_cb(JabberStream *js, const char *from, if(!(query = xmlnode_get_child(packet, "query"))) { char *err = jabber_parse_error(js, packet, NULL); purple_notify_error(js->gc, _("Error"), - _("Error retrieving room list"), err); + _("Error retrieving room list"), err, + purple_request_cpar_from_connection(js->gc)); purple_roomlist_set_in_progress(js->roomlist, FALSE); purple_roomlist_unref(js->roomlist); js->roomlist = NULL; @@ -868,7 +883,9 @@ static void roomlist_ok_cb(JabberStream *js, const char *server) return; if(!server || !*server) { - purple_notify_error(js->gc, _("Invalid Server"), _("Invalid Server"), NULL); + purple_notify_error(js->gc, _("Invalid Server"), + _("Invalid Server"), NULL, + purple_request_cpar_from_connection(js->gc)); purple_roomlist_set_in_progress(js->roomlist, FALSE); return; } diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 594effe077..ac3c9be786 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -1148,7 +1148,8 @@ jabber_registration_result_cb(JabberStream *js, const char *from, to); } purple_notify_info(NULL, _("Registration Successful"), - _("Registration Successful"), buf); + _("Registration Successful"), buf, + purple_request_cpar_from_connection(js->gc)); g_free(buf); } else { char *msg = jabber_parse_error(js, packet, NULL); @@ -1157,7 +1158,8 @@ jabber_registration_result_cb(JabberStream *js, const char *from, msg = g_strdup(_("Unknown Error")); purple_notify_error(NULL, _("Registration Failed"), - _("Registration Failed"), msg); + _("Registration Failed"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); purple_account_register_completed(account, FALSE); } @@ -1182,7 +1184,8 @@ jabber_unregistration_result_cb(JabberStream *js, const char *from, buf = g_strdup_printf(_("Registration from %s successfully removed"), to); purple_notify_info(NULL, _("Unregistration Successful"), - _("Unregistration Successful"), buf); + _("Unregistration Successful"), buf, + purple_request_cpar_from_connection(js->gc)); g_free(buf); } else { char *msg = jabber_parse_error(js, packet, NULL); @@ -1191,7 +1194,8 @@ jabber_unregistration_result_cb(JabberStream *js, const char *from, msg = g_strdup(_("Unknown Error")); purple_notify_error(NULL, _("Unregistration Failed"), - _("Unregistration Failed"), msg); + _("Unregistration Failed"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); } g_free(to); @@ -1351,7 +1355,8 @@ void jabber_register_parse(JabberStream *js, const char *from, JabberIqType type if(js->registration) { purple_notify_error(NULL, _("Already Registered"), - _("Already Registered"), NULL); + _("Already Registered"), NULL, + purple_request_cpar_from_connection(js->gc)); purple_account_register_completed(account, FALSE); jabber_connection_schedule_close(js); return; @@ -1515,13 +1520,15 @@ jabber_unregister_account_iq_cb(JabberStream *js, const char *from, char *msg = jabber_parse_error(js, packet, NULL); purple_notify_error(js->gc, _("Error unregistering account"), - _("Error unregistering account"), msg); + _("Error unregistering account"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); if(js->unregistration_cb) js->unregistration_cb(account, FALSE, js->unregistration_user_data); } else { - purple_notify_info(js->gc, _("Account successfully unregistered"), - _("Account successfully unregistered"), NULL); + purple_notify_info(js->gc, _("Account successfully " + "unregistered"), _("Account successfully unregistered"), + NULL, purple_request_cpar_from_connection(js->gc)); if(js->unregistration_cb) js->unregistration_cb(account, TRUE, js->unregistration_user_data); } @@ -1902,7 +1909,8 @@ void jabber_add_deny(PurpleConnection *gc, const char *who) if (!(js->server_caps & JABBER_CAP_BLOCKING)) { purple_notify_error(NULL, _("Server doesn't support blocking"), - _("Server doesn't support blocking"), NULL); + _("Server doesn't support blocking"), NULL, + purple_request_cpar_from_connection(gc)); return; } @@ -2461,15 +2469,17 @@ jabber_password_change_result_cb(JabberStream *js, const char *from, xmlnode *packet, gpointer data) { if (type == JABBER_IQ_RESULT) { - purple_notify_info(js->gc, _("Password Changed"), _("Password Changed"), - _("Your password has been changed.")); + purple_notify_info(js->gc, _("Password Changed"), _("Password " + "Changed"), _("Your password has been changed."), + purple_request_cpar_from_connection(js->gc)); purple_account_set_password(purple_connection_get_account(js->gc), (const char *)data, NULL, NULL); } else { char *msg = jabber_parse_error(js, packet, NULL); purple_notify_error(js->gc, _("Error changing password"), - _("Error changing password"), msg); + _("Error changing password"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); } @@ -2487,7 +2497,9 @@ static void jabber_password_change_cb(JabberStream *js, p2 = purple_request_fields_get_string(fields, "password2"); if(strcmp(p1, p2)) { - purple_notify_error(js->gc, NULL, _("New passwords do not match."), NULL); + purple_notify_error(js->gc, NULL, + _("New passwords do not match."), NULL, + purple_request_cpar_from_connection(js->gc)); return; } @@ -3300,7 +3312,8 @@ jabber_initiate_media(PurpleAccount *account, const char *who, } purple_notify_error(account, _("Media Initiation Failed"), - _("Media Initiation Failed"), msg); + _("Media Initiation Failed"), msg, + purple_request_cpar_from_connection(gc)); g_free(msg); g_free(resource); return FALSE; diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c index 1b43958874..52298bf942 100644 --- a/libpurple/protocols/jabber/presence.c +++ b/libpurple/protocols/jabber/presence.c @@ -554,7 +554,8 @@ handle_presence_chat(JabberStream *js, JabberPresence *presence, xmlnode *packet if (g_hash_table_size(chat->members) == 0) serv_got_chat_left(js->gc, chat->id); } - purple_notify_error(js->gc, title, title, msg); + purple_notify_error(js->gc, title, title, msg, + purple_request_cpar_from_connection(js->gc)); g_free(title); g_free(msg); diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c index f2fbb2fcd3..9c35920e3f 100644 --- a/libpurple/protocols/jabber/si.c +++ b/libpurple/protocols/jabber/si.c @@ -1433,7 +1433,8 @@ static void jabber_si_xfer_send_disco_cb(JabberStream *js, const char *who, } else { char *msg = g_strdup_printf(_("Unable to send file to %s, user does not support file transfers"), who); purple_notify_error(js->gc, _("File Send Failed"), - _("File Send Failed"), msg); + _("File Send Failed"), msg, + purple_request_cpar_from_connection(js->gc)); g_free(msg); purple_xfer_cancel_local(xfer); } @@ -1474,7 +1475,8 @@ static void do_transfer_send(PurpleXfer *xfer, const char *resource) msg = g_strdup_printf(_("Unable to send file to %s, user does not support file transfers"), who); purple_notify_error(jsx->js->gc, _("File Send Failed"), - _("File Send Failed"), msg); + _("File Send Failed"), msg, + purple_request_cpar_from_connection(jsx->js->gc)); g_free(msg); purple_xfer_cancel_local(xfer); } else { @@ -1541,7 +1543,9 @@ static void jabber_si_xfer_init(PurpleXfer *xfer) msg = g_strdup_printf(_("Unable to send file to %s, not subscribed to user presence"), purple_xfer_get_remote_user(xfer)); } - purple_notify_error(jsx->js->gc, _("File Send Failed"), _("File Send Failed"), msg); + purple_notify_error(jsx->js->gc, _("File Send Failed"), + _("File Send Failed"), msg, + purple_request_cpar_from_connection(jsx->js->gc)); g_free(msg); } else if (g_list_length(resources) == 1) { /* only 1 resource online (probably our most common case) diff --git a/libpurple/protocols/msn/contact.c b/libpurple/protocols/msn/contact.c index e5f18c230f..2a8e18ea73 100644 --- a/libpurple/protocols/msn/contact.c +++ b/libpurple/protocols/msn/contact.c @@ -1069,8 +1069,11 @@ msn_add_contact_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, } else if (errorcode && !strcmp(errorcode, "InvalidPassportUser")) { PurpleBuddy *buddy = purple_find_buddy(session->account, state->who); char *str = g_strdup_printf(_("Unable to add \"%s\"."), state->who); - purple_notify_error(state->session, _("Buddy Add error"), str, - _("The username specified does not exist.")); + purple_notify_error(state->session, + _("Buddy Add error"), str, + _("The username specified does not exist."), + purple_request_cpar_from_account( + session->account)); g_free(str); msn_userlist_rem_buddy(userlist, state->who); if (buddy != NULL) @@ -1166,7 +1169,9 @@ msn_add_contact_to_group_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, PurpleBuddy *buddy = purple_find_buddy(session->account, state->who); char *str = g_strdup_printf(_("Unable to add \"%s\"."), state->who); purple_notify_error(session, _("Buddy Add error"), str, - _("The username specified does not exist.")); + _("The username specified does not exist."), + purple_request_cpar_from_account( + session->account)); g_free(str); msn_userlist_rem_buddy(userlist, state->who); if (buddy != NULL) diff --git a/libpurple/protocols/msn/error.c b/libpurple/protocols/msn/error.c index 88a783d759..40e80598c9 100644 --- a/libpurple/protocols/msn/error.c +++ b/libpurple/protocols/msn/error.c @@ -273,8 +273,12 @@ msn_error_handle(MsnSession *session, unsigned int type) msn_error_get_text(type, &debug)); if (debug) purple_debug_warning("msn", "error %d: %s\n", type, buf); - else - purple_notify_error(purple_account_get_connection(session->account), NULL, buf, NULL); + else { + purple_notify_error( + purple_account_get_connection(session->account), NULL, + buf, NULL, purple_request_cpar_from_account( + session->account)); + } g_free(buf); } diff --git a/libpurple/protocols/msn/msn.c b/libpurple/protocols/msn/msn.c index 93454e8d70..f6c75e802d 100644 --- a/libpurple/protocols/msn/msn.c +++ b/libpurple/protocols/msn/msn.c @@ -258,9 +258,9 @@ msn_set_public_alias(PurpleConnection *pc, const char *alias, closure->failure_cb = failure_cb; purple_timeout_add(0, set_public_alias_length_error, closure); } else { - purple_notify_error(pc, NULL, - _("Your new MSN friendly name is too long."), - NULL); + purple_notify_error(pc, NULL, _("Your new MSN " + "friendly name is too long."), NULL, + purple_request_cpar_from_connection(pc)); } return; } @@ -744,8 +744,9 @@ msn_show_hotmail_inbox(PurplePluginAction *action) session = purple_connection_get_protocol_data(gc); if (!session->passport_info.email_enabled) { - purple_notify_error(gc, NULL, - _("This account does not have email enabled."), NULL); + purple_notify_error(gc, NULL, _("This account does not have " + "email enabled."), NULL, + purple_request_cpar_from_connection(gc)); return; } @@ -1782,8 +1783,10 @@ msn_add_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group, cons if (!msn_email_is_valid(bname)) { gchar *buf; buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be valid email addresses."), bname); - if (!purple_conv_present_error(bname, account, buf)) - purple_notify_error(pc, NULL, _("Unable to Add"), buf); + if (!purple_conv_present_error(bname, account, buf)) { + purple_notify_error(pc, NULL, _("Unable to Add"), buf, + purple_request_cpar_from_connection(pc)); + } g_free(buf); /* Remove from local list */ diff --git a/libpurple/protocols/msn/notification.c b/libpurple/protocols/msn/notification.c index 969e6af088..f4b8ea9de8 100644 --- a/libpurple/protocols/msn/notification.c +++ b/libpurple/protocols/msn/notification.c @@ -822,7 +822,7 @@ adl_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) purple_notify_error(gc, NULL, _("The following users are missing from your addressbook"), - emails->str); + emails->str, purple_request_cpar_from_connection(gc)); g_string_free(emails, TRUE); xmlnode_free(adl); } @@ -833,7 +833,8 @@ adl_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) error, adl); g_free(adl); - purple_notify_error(gc, NULL, _("Unable to add user"), reason); + purple_notify_error(gc, NULL, _("Unable to add user"), reason, + purple_request_cpar_from_connection(gc)); g_free(reason); } } @@ -857,7 +858,8 @@ adl_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) cmd->payload_cbdata = GINT_TO_POINTER(error); } else { char *reason = g_strdup_printf(_("Unknown error (%d)"), error); - purple_notify_error(gc, NULL, _("Unable to add user"), reason); + purple_notify_error(gc, NULL, _("Unable to add user"), reason, + purple_request_cpar_from_connection(gc)); g_free(reason); } } @@ -880,7 +882,8 @@ rml_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) error, adl); g_free(adl); - purple_notify_error(gc, NULL, _("Unable to remove user"), reason); + purple_notify_error(gc, NULL, _("Unable to remove user"), reason, + purple_request_cpar_from_connection(gc)); g_free(reason); } @@ -903,7 +906,8 @@ rml_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) cmd->payload_cbdata = GINT_TO_POINTER(error); } else { char *reason = g_strdup_printf(_("Unknown error (%d)"), error); - purple_notify_error(gc, NULL, _("Unable to remove user"), reason); + purple_notify_error(gc, NULL, _("Unable to remove user"), + reason, purple_request_cpar_from_connection(gc)); g_free(reason); } } @@ -2249,7 +2253,10 @@ system_msg(MsnCmdProc *cmdproc, MsnMessage *msg) } if (*buf != '\0') - purple_notify_info(purple_account_get_connection(cmdproc->session->account), NULL, buf, NULL); + purple_notify_info(purple_account_get_connection( + cmdproc->session->account), + NULL, buf, NULL, purple_request_cpar_from_account( + cmdproc->session->account)); } g_hash_table_destroy(table); diff --git a/libpurple/protocols/msn/userlist.c b/libpurple/protocols/msn/userlist.c index ce925030eb..feeab92b88 100644 --- a/libpurple/protocols/msn/userlist.c +++ b/libpurple/protocols/msn/userlist.c @@ -521,8 +521,9 @@ msn_userlist_add_buddy(MsnUserList *userlist, const char *who, const char *group char *str = g_strdup_printf(_("Unable to add \"%s\"."), who); - purple_notify_error(NULL, NULL, str, - _("The username specified is invalid.")); + purple_notify_error(NULL, NULL, str, _("The username specified " + "is invalid."), purple_request_cpar_from_account( + userlist->session->account)); g_free(str); return; diff --git a/libpurple/protocols/mxit/protocol.c b/libpurple/protocols/mxit/protocol.c index ba879d80e2..48e2d4c4de 100644 --- a/libpurple/protocols/mxit/protocol.c +++ b/libpurple/protocols/mxit/protocol.c @@ -74,7 +74,7 @@ gint64 mxit_now_milli( void ) void mxit_popup( int type, const char* heading, const char* message ) { /* (reference: "libpurple/notify.h") */ - purple_notify_message( NULL, type, _( MXIT_POPUP_WIN_NAME ), heading, message, NULL, NULL ); + purple_notify_message( NULL, type, _( MXIT_POPUP_WIN_NAME ), heading, message, NULL, NULL, NULL ); } diff --git a/libpurple/protocols/myspace/myspace.c b/libpurple/protocols/myspace/myspace.c index adf58d0814..8c8196627a 100644 --- a/libpurple/protocols/myspace/myspace.c +++ b/libpurple/protocols/myspace/myspace.c @@ -135,7 +135,9 @@ msim_postprocess_outgoing_cb(MsimSession *session, const MsimMessage *userinfo, msg = g_strdup_printf(_("No such user: %s"), username); if (!purple_conv_present_error(username, session->account, msg)) { - purple_notify_error(NULL, NULL, _("User lookup"), msg); + purple_notify_error(NULL, NULL, _("User lookup"), msg, + purple_request_cpar_from_connection( + session->gc)); } g_free(msg); @@ -1137,7 +1139,10 @@ msim_got_contact_list(MsimSession *session, const MsimMessage *reply, gpointer u "%d buddies were added or updated from the server (including buddies already on the server-side list)", buddy_count), buddy_count); - purple_notify_info(session->account, _("Add contacts from server"), msg, NULL); + purple_notify_info(session->account, + _("Add contacts from server"), msg, NULL, + purple_request_cpar_from_connection( + session->gc)); g_free(msg); break; @@ -1861,7 +1866,9 @@ msim_error(MsimSession *session, MsimMessage *msg) } purple_connection_error(session->gc, reason, full_errmsg); } else { - purple_notify_error(session->account, _("MySpaceIM Error"), full_errmsg, NULL); + purple_notify_error(session->account, _("MySpaceIM Error"), + full_errmsg, NULL, + purple_request_cpar_from_connection(session->gc)); } g_free(full_errmsg); @@ -2648,7 +2655,9 @@ msim_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, con NULL); if (!msim_postprocess_outgoing(session, msg, name, "newprofileid", "reason")) { - purple_notify_error(NULL, NULL, _("Failed to add buddy"), _("'addbuddy' command failed.")); + purple_notify_error(NULL, NULL, _("Failed to add buddy"), + _("'addbuddy' command failed."), + purple_request_cpar_from_connection(session->gc)); msim_msg_free(msg); return; } @@ -2682,7 +2691,9 @@ msim_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, con if (!msim_postprocess_outgoing(session, msg_persist, name, "body", NULL)) { - purple_notify_error(NULL, NULL, _("Failed to add buddy"), _("persist command failed")); + purple_notify_error(NULL, NULL, _("Failed to add buddy"), + _("persist command failed"), + purple_request_cpar_from_connection(session->gc)); msim_msg_free(msg_persist); return; } @@ -2713,7 +2724,9 @@ msim_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) NULL); if (!msim_postprocess_outgoing(session, delbuddy_msg, name, "delprofileid", NULL)) { - purple_notify_error(NULL, NULL, _("Failed to remove buddy"), _("'delbuddy' command failed")); + purple_notify_error(NULL, NULL, _("Failed to remove buddy"), + _("'delbuddy' command failed"), + purple_request_cpar_from_connection(session->gc)); msim_msg_free(delbuddy_msg); return; } @@ -2732,7 +2745,9 @@ msim_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) NULL); if (!msim_postprocess_outgoing(session, persist_msg, name, "body", NULL)) { - purple_notify_error(NULL, NULL, _("Failed to remove buddy"), _("persist command failed")); + purple_notify_error(NULL, NULL, _("Failed to remove buddy"), + _("persist command failed"), + purple_request_cpar_from_connection(session->gc)); msim_msg_free(persist_msg); return; } @@ -2744,8 +2759,9 @@ msim_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) * does it) */ if (!msim_update_blocklist_for_buddy(session, name, FALSE, FALSE)) { - purple_notify_error(NULL, NULL, - _("Failed to remove buddy"), _("blocklist command failed")); + purple_notify_error(NULL, NULL, _("Failed to remove buddy"), + _("blocklist command failed"), + purple_request_cpar_from_connection(session->gc)); return; } msim_buddy_free(buddy); @@ -3088,14 +3104,16 @@ static PurplePluginProtocolInfo prpl_info = { static gboolean msim_load(PurplePlugin *plugin) { - /* If compiled to use RC4 from libpurple, check if it is really there. */ + /* If compiled to use RC4 from libpurple, check if it is really there. + * It should for 3.x.y. + */ if (!purple_ciphers_find_cipher("rc4")) { purple_debug_error("msim", "rc4 not in libpurple, but it is required - not loading MySpaceIM plugin!\n"); purple_notify_error(plugin, _("Missing Cipher"), _("The RC4 cipher could not be found"), _("Upgrade " "to a libpurple with RC4 support (>= 2.0.1). MySpaceIM " - "plugin will not be loaded.")); + "plugin will not be loaded."), NULL); return FALSE; } return TRUE; @@ -3121,7 +3139,8 @@ msim_import_friends_cb(MsimSession *session, const MsimMessage *reply, gpointer purple_debug_info("msim_import_friends_cb", "failed to import friends: %s", completed); purple_notify_error(session->account, _("Add friends from MySpace.com"), - _("Importing friends failed"), NULL); + _("Importing friends failed"), NULL, + purple_request_cpar_from_connection(session->gc)); g_free(completed); return; } @@ -3481,7 +3500,7 @@ msim_uri_handler(const gchar *proto, const gchar *cmd, GHashTable *params) if (!account) { purple_notify_error(NULL, _("myim URL handler"), _("No suitable MySpaceIM account could be found to open this myim URL."), - _("Enable the proper MySpaceIM account and try again.")); + _("Enable the proper MySpaceIM account and try again."), NULL); g_free(cid_str); return FALSE; } diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c index ec1776604e..6276163a16 100644 --- a/libpurple/protocols/novell/novell.c +++ b/libpurple/protocols/novell/novell.c @@ -256,7 +256,8 @@ _get_details_resp_send_msg(NMUser * user, NMERR_T ret_code, " Could not get details for user (%s)."), nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -403,7 +404,8 @@ _create_contact_resp_cb(NMUser * user, NMERR_T ret_code, err = g_strdup_printf(_("Unable to add %s to your buddy list (%s)."), name, nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -429,7 +431,8 @@ _send_message_resp_cb(NMUser * user, NMERR_T ret_code, /* TODO: Improve this! message to who or for what conference? */ err = g_strdup_printf(_("Unable to send message (%s)."), nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } } @@ -499,7 +502,8 @@ _sendinvite_resp_cb(NMUser *user, NMERR_T ret_code, if (ret_code != NM_OK) { gc = purple_account_get_connection(user->client_data); err = g_strdup_printf(_("Unable to invite user (%s)."), nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); purple_debug(PURPLE_DEBUG_INFO, "novell", @@ -546,7 +550,8 @@ _createconf_resp_send_msg(NMUser * user, NMERR_T ret_code, " Could not create the conference (%s)."), nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -596,7 +601,8 @@ _create_folder_resp_move_contact(NMUser * user, NMERR_T ret_code, folder_name, nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -641,7 +647,8 @@ _create_folder_resp_add_contact(NMUser * user, NMERR_T ret_code, " Error creating folder in server side list (%s)."), name, nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); nm_release_contact(contact); g_free(err); @@ -712,7 +719,8 @@ _get_details_resp_show_info(NMUser * user, NMERR_T ret_code, err = g_strdup_printf(_("Could not get details for user %s (%s)."), name, nm_error_to_string (ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -758,7 +766,8 @@ _get_details_resp_add_privacy_item(NMUser *user, NMERR_T ret_code, err = g_strdup_printf(_("Unable to add user to privacy list (%s)."), nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -805,7 +814,8 @@ _create_privacy_item_deny_resp_cb(NMUser *user, NMERR_T ret_code, err = g_strdup_printf(_("Unable to add %s to deny list (%s)."), who, nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -858,7 +868,8 @@ _create_privacy_item_permit_resp_cb(NMUser *user, NMERR_T ret_code, err = g_strdup_printf(_("Unable to add %s to permit list (%s)."), who, nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -904,7 +915,8 @@ _get_details_send_privacy_create(NMUser *user, NMERR_T ret_code, err = g_strdup_printf(_("Unable to add user to privacy list (%s)."), nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -926,7 +938,8 @@ _remove_privacy_item_resp_cb(NMUser *user, NMERR_T ret_code, gc = purple_account_get_connection(user->client_data); err = g_strdup_printf(_("Unable to remove %s from privacy list (%s)."), who, nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -949,7 +962,8 @@ _set_privacy_default_resp_cb(NMUser *user, NMERR_T ret_code, gc = purple_account_get_connection(user->client_data); err = g_strdup_printf(_("Unable to change server side privacy settings (%s)."), nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -991,7 +1005,8 @@ _get_details_resp_send_invite(NMUser *user, NMERR_T ret_code, } else { err = g_strdup_printf(_("Unable to invite user (%s)."), nm_error_to_string(ret_code)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } @@ -1019,7 +1034,8 @@ _createconf_resp_send_invite(NMUser * user, NMERR_T ret_code, } else { err = g_strdup_printf(_("Unable to create conference (%s)."), nm_error_to_string(ret_code)); gc = purple_account_get_connection(user->client_data); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } } @@ -1664,7 +1680,8 @@ _show_privacy_locked_error(PurpleConnection *gc, NMUser *user) err = g_strdup_printf(_("Unable to change server side privacy settings (%s)."), nm_error_to_string(NMERR_ADMIN_LOCKED)); - purple_notify_error(gc, NULL, err, NULL); + purple_notify_error(gc, NULL, err, NULL, + purple_request_cpar_from_connection(gc)); g_free(err); } diff --git a/libpurple/protocols/oscar/family_chatnav.c b/libpurple/protocols/oscar/family_chatnav.c index c8527b7b0c..a81a07733f 100644 --- a/libpurple/protocols/oscar/family_chatnav.c +++ b/libpurple/protocols/oscar/family_chatnav.c @@ -63,7 +63,9 @@ error(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, "Could not join room, error=0x%04hx, chatnav_error=0x%04hx\n", error, chatnav_error); purple_notify_error(od->gc, NULL, _("Could not join chat room"), - chatnav_error == 0x0033 ? _("Invalid chat room name") : _("Unknown error")); + chatnav_error == 0x0033 ? _("Invalid chat room name") : + _("Unknown error"), + purple_request_cpar_from_connection(od->gc)); ret = 1; } diff --git a/libpurple/protocols/oscar/family_icbm.c b/libpurple/protocols/oscar/family_icbm.c index d87d8af017..8c4ae1b9c2 100644 --- a/libpurple/protocols/oscar/family_icbm.c +++ b/libpurple/protocols/oscar/family_icbm.c @@ -183,7 +183,8 @@ error(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, else buf = g_strdup_printf(_("Unable to send message to %s: %s"), bn ? bn : "(unknown)", reason_str); - purple_notify_error(od->gc, NULL, buf, reason_str); + purple_notify_error(od->gc, NULL, buf, reason_str, + purple_request_cpar_from_connection(od->gc)); } g_free(buf); diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c index 95a1c4ee14..60b650a083 100644 --- a/libpurple/protocols/oscar/oscar.c +++ b/libpurple/protocols/oscar/oscar.c @@ -1755,23 +1755,21 @@ incomingim_chan4(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, case 0x07: { /* Someone has denied you authorization */ if (i >= 1) { gchar *dialog_msg = g_strdup_printf(_("The user %u has denied your request to add them to your buddy list for the following reason:\n%s"), args->uin, msg2[0] ? msg2[0] : _("No reason given.")); - purple_notify_info(gc, NULL, _("ICQ authorization denied."), - dialog_msg); + purple_notify_info(gc, NULL, _("ICQ authorization denied."), dialog_msg, purple_request_cpar_from_connection(gc)); g_free(dialog_msg); } } break; case 0x08: { /* Someone has granted you authorization */ gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin); - purple_notify_info(gc, NULL, "ICQ authorization accepted.", - dialog_msg); + purple_notify_info(gc, NULL, "ICQ authorization accepted.", dialog_msg, purple_request_cpar_from_connection(gc)); g_free(dialog_msg); } break; case 0x09: { /* Message from the Godly ICQ server itself, I think */ if (i >= 5) { gchar *dialog_msg = g_strdup_printf(_("You have received a special message\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); - purple_notify_info(gc, NULL, "ICQ Server Message", dialog_msg); + purple_notify_info(gc, NULL, "ICQ Server Message", dialog_msg, purple_request_cpar_from_connection(gc)); g_free(dialog_msg); } } break; @@ -1779,7 +1777,7 @@ incomingim_chan4(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, case 0x0d: { /* Someone has sent you a pager message from http://www.icq.com/your_uin */ if (i >= 6) { gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ page\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); - purple_notify_info(gc, NULL, "ICQ Page", dialog_msg); + purple_notify_info(gc, NULL, "ICQ Page", dialog_msg, purple_request_cpar_from_connection(gc)); g_free(dialog_msg); } } break; @@ -1787,7 +1785,7 @@ incomingim_chan4(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, case 0x0e: { /* Someone has emailed you at your_uin@pager.icq.com */ if (i >= 6) { gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ email from %s [%s]\n\nMessage is:\n%s"), msg2[0], msg2[3], msg2[5]); - purple_notify_info(gc, NULL, "ICQ Email", dialog_msg); + purple_notify_info(gc, NULL, "ICQ Email", dialog_msg, purple_request_cpar_from_connection(gc)); g_free(dialog_msg); } } break; @@ -2035,8 +2033,10 @@ static int purple_parse_misses(OscarData *od, FlapConnection *conn, FlapFrame *f break; } - if (!purple_conv_present_error(userinfo->bn, account, buf)) - purple_notify_error(od->gc, NULL, buf, NULL); + if (!purple_conv_present_error(userinfo->bn, account, buf)) { + purple_notify_error(od->gc, NULL, buf, NULL, + purple_request_cpar_from_connection(od->gc)); + } g_free(buf); return 1; @@ -2233,9 +2233,11 @@ static int purple_parse_motd(OscarData *od, FlapConnection *conn, FlapFrame *fr, purple_debug_misc("oscar", "MOTD: %s (%hu)\n", msg ? msg : "Unknown", id); - if (id < 4) + if (id < 4) { purple_notify_warning(od->gc, NULL, - _("Your AIM connection may be lost."), NULL); + _("Your AIM connection may be lost."), NULL, + purple_request_cpar_from_connection(od->gc)); + } return 1; } @@ -2642,7 +2644,8 @@ static void oscar_format_username(PurpleConnection *gc, const char *new_display_ username = purple_account_get_username(purple_connection_get_account(gc)); if (oscar_util_name_compare(username, new_display_name)) { purple_notify_error(gc, NULL, _("The new formatting is invalid."), - _("Username formatting can change only capitalization and whitespace.")); + _("Username formatting can change only capitalization and whitespace."), + purple_request_cpar_from_connection(gc)); return; } @@ -2808,9 +2811,9 @@ static int purple_parse_searchreply(OscarData *od, FlapConnection *conn, FlapFra if (results == NULL) { purple_debug_error("oscar", "purple_parse_searchreply: " "Unable to display the search results.\n"); - purple_notify_error(gc, NULL, - _("Unable to display the search results."), - NULL); + purple_notify_error(gc, NULL, _("Unable to display the search " + "results."), NULL, + purple_request_cpar_from_connection(gc)); return 1; } @@ -2847,7 +2850,8 @@ static int purple_parse_searcherror(OscarData *od, FlapConnection *conn, FlapFra va_end(ap); buf = g_strdup_printf(_("No results found for email address %s"), email); - purple_notify_error(od->gc, NULL, buf, NULL); + purple_notify_error(od->gc, NULL, buf, NULL, + purple_request_cpar_from_connection(od->gc)); g_free(buf); return 1; @@ -2869,7 +2873,8 @@ static int purple_account_confirm(OscarData *od, FlapConnection *conn, FlapFrame if (!status) { g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."), purple_account_get_username(purple_connection_get_account(gc))); - purple_notify_info(gc, NULL, _("Account Confirmation Requested"), msg); + purple_notify_info(gc, NULL, _("Account Confirmation Requested"), + msg, purple_request_cpar_from_connection(gc)); } return 1; @@ -2915,8 +2920,8 @@ static int purple_info_change(OscarData *od, FlapConnection *conn, FlapFrame *fr dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address is invalid."), err); else dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err); - purple_notify_error(gc, NULL, - _("Error Changing Account Info"), dialog_msg); + purple_notify_error(gc, NULL, _("Error Changing Account Info"), + dialog_msg, purple_request_cpar_from_connection(gc)); g_free(dialog_msg); return 1; } @@ -2924,7 +2929,8 @@ static int purple_info_change(OscarData *od, FlapConnection *conn, FlapFrame *fr if (email != NULL) { char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), purple_account_get_username(purple_connection_get_account(gc)), email); - purple_notify_info(gc, NULL, _("Account Info"), dialog_msg); + purple_notify_info(gc, NULL, _("Account Info"), dialog_msg, + purple_request_cpar_from_connection(gc)); g_free(dialog_msg); } @@ -3345,7 +3351,8 @@ oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char * _("You have probably requested to set your " "profile before the login procedure completed. " "Your profile remains unset; try setting it " - "again when you are fully connected.")); + "again when you are fully connected."), + purple_request_cpar_from_connection(gc)); } else if (rawinfo != NULL) { @@ -3361,7 +3368,8 @@ oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char * "The maximum profile length of %d bytes " "has been exceeded. It has been truncated for you.", od->rights.maxsiglen), od->rights.maxsiglen); - purple_notify_warning(gc, NULL, _("Profile too long."), errstr); + purple_notify_warning(gc, NULL, _("Profile too long."), + errstr, purple_request_cpar_from_connection(gc)); g_free(errstr); } } @@ -3395,7 +3403,9 @@ oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char * "The maximum away message length of %d bytes " "has been exceeded. It has been truncated for you.", od->rights.maxawaymsglen), od->rights.maxawaymsglen); - purple_notify_warning(gc, NULL, _("Away message too long."), errstr); + purple_notify_warning(gc, NULL, + _("Away message too long."), errstr, + purple_request_cpar_from_connection(gc)); g_free(errstr); } } @@ -3497,7 +3507,7 @@ oscar_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, co gchar *buf; buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); if (!purple_conv_present_error(bname, account, buf)) - purple_notify_error(gc, NULL, _("Unable to Add"), buf); + purple_notify_error(gc, NULL, _("Unable to Add"), buf, purple_request_cpar_from_connection(gc)); g_free(buf); /* Remove from local list */ @@ -3634,7 +3644,8 @@ static int purple_ssi_parseerr(OscarData *od, FlapConnection *conn, FlapFrame *f _("Unable to Retrieve Buddy List"), _("The AIM servers were temporarily unable to send " "your buddy list. Your buddy list is not lost, and " - "will probably become available in a few minutes.")); + "will probably become available in a few minutes."), + purple_request_cpar_from_connection(gc)); od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); return 1; } @@ -3963,7 +3974,7 @@ static int purple_ssi_parseack(OscarData *od, FlapConnection *conn, FlapFrame *f gchar *buf; buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) - purple_notify_error(gc, NULL, _("Unable to Add"), buf); + purple_notify_error(gc, NULL, _("Unable to Add"), buf, purple_request_cpar_from_connection(gc)); g_free(buf); } break; @@ -3978,7 +3989,7 @@ static int purple_ssi_parseack(OscarData *od, FlapConnection *conn, FlapFrame *f buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."), (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) - purple_notify_error(gc, NULL, _("Unable to Add"), buf); + purple_notify_error(gc, NULL, _("Unable to Add"), buf, purple_request_cpar_from_connection(gc)); g_free(buf); } break; } @@ -4164,11 +4175,13 @@ static int purple_ssi_authreply(OscarData *od, FlapConnection *conn, FlapFrame * if (reply) { /* Granted */ dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre); - purple_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg); + purple_notify_info(gc, NULL, _("Authorization Granted"), + dialog_msg, purple_request_cpar_from_connection(gc)); } else { /* Denied */ dialog_msg = g_strdup_printf(_("The user %s has denied your request to add them to your buddy list for the following reason:\n%s"), nombre, msg ? msg : _("No reason given.")); - purple_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg); + purple_notify_info(gc, NULL, _("Authorization Denied"), + dialog_msg, purple_request_cpar_from_connection(gc)); } g_free(dialog_msg); g_free(nombre); diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c index d283539440..d7deb204f4 100644 --- a/libpurple/protocols/sametime/sametime.c +++ b/libpurple/protocols/sametime/sametime.c @@ -1710,7 +1710,8 @@ static void mw_session_admin(struct mwSession *session, purple_notify_message(gc, PURPLE_NOTIFY_MSG_INFO, _("Sametime Administrator Announcement"), - prim, text, NULL, NULL); + prim, text, NULL, NULL, + purple_request_cpar_from_connection(gc)); g_free(prim); } @@ -2014,7 +2015,8 @@ static void mw_conf_closed(struct mwConference *conf, guint32 reason) { serv_got_chat_left(gc, CONF_TO_ID(conf)); - purple_notify_error(gc, _("Conference Closed"), NULL, msg); + purple_notify_error(gc, _("Conference Closed"), NULL, msg, + purple_request_cpar_from_connection(gc)); g_free(msg); } @@ -2453,6 +2455,7 @@ static void convo_queue(struct mwConversation *conv, /* Does what it takes to get an error displayed for a conversation */ static void convo_error(struct mwConversation *conv, guint32 err) { PurpleConversation *gconv; + PurpleConnection *pc; char *tmp, *text; struct mwIdBlock *idb; @@ -2467,8 +2470,8 @@ static void convo_error(struct mwConversation *conv, guint32 err) { g_free(text); text = g_strdup_printf(_("Unable to send message to %s:"), (idb->user)? idb->user: "(unknown)"); - purple_notify_error(purple_account_get_connection(purple_conversation_get_account(gconv)), - NULL, text, tmp); + pc = purple_account_get_connection(purple_conversation_get_account(gconv)); + purple_notify_error(pc, NULL, text, tmp, purple_request_cpar_from_connection(pc)); } g_free(tmp); @@ -3023,7 +3026,8 @@ static void mw_place_closed(struct mwPlace *place, guint32 code) { serv_got_chat_left(gc, PLACE_TO_ID(place)); - purple_notify_error(gc, _("Place Closed"), NULL, msg); + purple_notify_error(gc, _("Place Closed"), NULL, msg, + purple_request_cpar_from_connection(gc)); g_free(msg); } @@ -5328,7 +5332,8 @@ static void remote_group_done(struct mwPurplePluginData *pd, msgB = _("A group named '%s' already exists in your buddy list."); msg = g_strdup_printf(msgB, name); - purple_notify_error(gc, _("Unable to add group"), msgA, msg); + purple_notify_error(gc, _("Unable to add group"), msgA, msg, + purple_request_cpar_from_connection(gc)); g_free(msg); return; @@ -5458,7 +5463,8 @@ static void remote_group_resolved(struct mwServiceResolve *srvc, " groups in your Sametime community."); msg = g_strdup_printf(msgB, res->name); - purple_notify_error(gc, _("Unable to add group"), msgA, msg); + purple_notify_error(gc, _("Unable to add group"), msgA, msg, + purple_request_cpar_from_connection(gc)); g_free(msg); } @@ -5583,7 +5589,8 @@ static void search_resolved(struct mwServiceResolve *srvc, " Sametime community."); msg = g_strdup_printf(msgB, (res && res->name) ? NSTR(res->name) : ""); - purple_notify_error(gc, _("No Matches"), msgA, msg); + purple_notify_error(gc, _("No Matches"), msgA, msg, + purple_request_cpar_from_connection(gc)); g_free(msg); } diff --git a/libpurple/protocols/silc/buddy.c b/libpurple/protocols/silc/buddy.c index 10ac3a3d08..feb2f8cafa 100644 --- a/libpurple/protocols/silc/buddy.c +++ b/libpurple/protocols/silc/buddy.c @@ -52,7 +52,8 @@ silcpurple_buddy_keyagr_resolved(SilcClient client, g_snprintf(tmp, sizeof(tmp), _("User %s is not present in the network"), r->nick); purple_notify_error(gc, _("Key Agreement"), - _("Cannot perform the key agreement"), tmp); + _("Cannot perform the key agreement"), tmp, + purple_request_cpar_from_connection(gc)); g_free(r->nick); silc_free(r); return; @@ -109,32 +110,38 @@ silcpurple_buddy_keyagr_cb(SilcClient client, case SILC_KEY_AGREEMENT_ERROR: purple_notify_error(gc, _("Key Agreement"), - _("Error occurred during key agreement"), NULL); + _("Error occurred during key agreement"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_KEY_AGREEMENT_FAILURE: - purple_notify_error(gc, _("Key Agreement"), _("Key Agreement failed"), NULL); + purple_notify_error(gc, _("Key Agreement"), + _("Key Agreement failed"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_KEY_AGREEMENT_TIMEOUT: purple_notify_error(gc, _("Key Agreement"), - _("Timeout during key agreement"), NULL); + _("Timeout during key agreement"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_KEY_AGREEMENT_ABORTED: purple_notify_error(gc, _("Key Agreement"), - _("Key agreement was aborted"), NULL); + _("Key agreement was aborted"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_KEY_AGREEMENT_ALREADY_STARTED: - purple_notify_error(gc, _("Key Agreement"), - _("Key agreement is already started"), NULL); + purple_notify_error(gc, _("Key Agreement"), _("Key agreement is" + " already started"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_KEY_AGREEMENT_SELF_DENIED: - purple_notify_error(gc, _("Key Agreement"), - _("Key agreement cannot be started with yourself"), - NULL); + purple_notify_error(gc, _("Key Agreement"), _("Key agreement " + "cannot be started with yourself"), NULL, + purple_request_cpar_from_connection(gc)); break; default: @@ -254,7 +261,7 @@ silcpurple_buddy_keyagr_request_cb(SilcPurpleKeyAgrAsk a, gint id) if (!client_entry) { purple_notify_error(a->client->application, _("Key Agreement"), _("The remote user is not present in the network any more"), - NULL); + NULL, NULL); goto out; } @@ -385,7 +392,7 @@ silcpurple_buddy_privkey_cb(SilcPurplePrivkey p, const char *passphrase) if (!client_entry) { purple_notify_error(p->client->application, _("IM With Password"), _("The remote user is not present in the network any more"), - NULL); + NULL, NULL); silc_free(p); return; } @@ -414,7 +421,7 @@ silcpurple_buddy_privkey_resolved(SilcClient client, _("User %s is not present in the network"), (const char *)context); purple_notify_error(client->application, _("IM With Password"), - _("Cannot set IM key"), tmp); + _("Cannot set IM key"), tmp, NULL); g_free(context); return; } @@ -499,7 +506,7 @@ silcpurple_buddy_getkey_cb(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(g->client->application, _("Get Public Key"), _("The remote user is not present in the network any more"), - NULL); + NULL, NULL); silc_free(g); return FALSE; } @@ -510,7 +517,7 @@ silcpurple_buddy_getkey_cb(SilcClient client, SilcClientConnection conn, if (!client_entry) { purple_notify_error(g->client->application, _("Get Public Key"), _("The remote user is not present in the network any more"), - NULL); + NULL, NULL); silc_free(g); return FALSE; } @@ -542,7 +549,7 @@ silcpurple_buddy_getkey_resolved(SilcClient client, _("User %s is not present in the network"), (const char *)context); purple_notify_error(client->application, _("Get Public Key"), - _("Cannot fetch the public key"), tmp); + _("Cannot fetch the public key"), tmp, NULL); g_free(context); return; } @@ -622,9 +629,9 @@ silcpurple_buddy_showkey(PurpleBlistNode *node, gpointer data) pkfile = purple_blist_node_get_string(node, "public-key"); if (!silc_pkcs_load_public_key(pkfile, &public_key)) { - purple_notify_error(gc, - _("Show Public Key"), - _("Could not load public key"), NULL); + purple_notify_error(gc, _("Show Public Key"), + _("Could not load public key"), NULL, + purple_request_cpar_from_connection(gc)); return; } @@ -704,7 +711,8 @@ void silcpurple_get_info(PurpleConnection *gc, const char *who) g_snprintf(tmp, sizeof(tmp), _("User %s is not present in the network"), purple_buddy_get_name(b)); purple_notify_error(gc, _("User Information"), - _("Cannot get user information"), tmp); + _("Cannot get user information"), tmp, + purple_request_cpar_from_connection(gc)); return; } @@ -730,7 +738,8 @@ silcpurple_add_buddy_pk_no(SilcPurpleBuddyRes r) purple_notify_error(r->client->application, _("Add Buddy"), tmp, _("You cannot receive buddy notifications until you " "import his/her public key. You can use the Get Public Key " - "command to get the public key.")); + "command to get the public key."), + purple_request_cpar_from_account(purple_buddy_get_account(r->b))); purple_prpl_got_user_status(purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), SILCPURPLE_STATUS_ID_OFFLINE, NULL); } @@ -1031,8 +1040,10 @@ silcpurple_add_buddy_ask_import(void *user_data, const char *name) /* Load the public key */ if (!silc_pkcs_load_public_key(name, &r->public_key)) { silcpurple_add_buddy_ask_pk_cb(r, 0); - purple_notify_error(r->client->application, - _("Add Buddy"), _("Could not load public key"), NULL); + purple_notify_error(r->client->application, _("Add Buddy"), + _("Could not load public key"), NULL, + purple_request_cpar_from_account( + purple_buddy_get_account(r->b))); return; } diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c index ecdd4055ca..a9f592616b 100644 --- a/libpurple/protocols/silc/chat.c +++ b/libpurple/protocols/silc/chat.c @@ -80,7 +80,8 @@ silcpurple_chat_getinfo_res(SilcClient client, g_snprintf(tmp, sizeof(tmp), _("Channel %s does not exist in the network"), chname); purple_notify_error(gc, _("Channel Information"), - _("Cannot get channel information"), tmp); + _("Cannot get channel information"), tmp, + purple_request_cpar_from_connection(gc)); return; } @@ -238,7 +239,7 @@ silcpurple_chat_chpk_add(void *user_data, const char *name) silc_free(sgc); purple_notify_error(client->application, _("Add Channel Public Key"), - _("Could not load public key"), NULL); + _("Could not load public key"), NULL, NULL); return; } @@ -1053,7 +1054,8 @@ void silcpurple_chat_join(PurpleConnection *gc, GHashTable *data) _("You have to join the %s channel before you are " "able to join the private group"), parentch); purple_notify_error(gc, _("Join Private Group"), - _("Cannot join private group"), tmp); + _("Cannot join private group"), tmp, + purple_request_cpar_from_connection(gc)); return; } @@ -1248,9 +1250,11 @@ int silcpurple_chat_send(PurpleConnection *gc, int id, const char *msg, } flags |= SILC_MESSAGE_FLAG_ACTION; } else if (strlen(msg) > 1 && msg[0] == '/') { - if (!silc_client_command_call(client, conn, msg + 1)) - purple_notify_error(gc, _("Call Command"), _("Cannot call command"), - _("Unknown command")); + if (!silc_client_command_call(client, conn, msg + 1)) { + purple_notify_error(gc, _("Call Command"), + _("Cannot call command"), _("Unknown command"), + purple_request_cpar_from_connection(gc)); + } g_free(tmp); return 0; } diff --git a/libpurple/protocols/silc/ft.c b/libpurple/protocols/silc/ft.c index a2c2d30f25..72da76dc82 100644 --- a/libpurple/protocols/silc/ft.c +++ b/libpurple/protocols/silc/ft.c @@ -83,9 +83,9 @@ silcpurple_ftp_monitor(SilcClient client, } if (status == SILC_CLIENT_FILE_MONITOR_DISCONNECT) { - purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), - _("Remote disconnected")); + purple_notify_error(gc, _("Secure File Transfer"), _("Error " + "during file transfer"), _("Remote disconnected"), + purple_request_cpar_from_connection(gc)); purple_xfer_set_status(xfer->xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE); purple_xfer_update_progress(xfer->xfer); silc_client_file_close(client, conn, session_id); @@ -100,27 +100,33 @@ silcpurple_ftp_monitor(SilcClient client, g_snprintf(tmp, sizeof(tmp), "No such file %s", filepath ? filepath : "[N/A]"); purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), tmp); + _("Error during file transfer"), tmp, + purple_request_cpar_from_connection(gc)); } else if (error == SILC_CLIENT_FILE_PERMISSION_DENIED) { purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), - _("Permission denied")); + _("Error during file transfer"), + _("Permission denied"), + purple_request_cpar_from_connection(gc)); } else if (error == SILC_CLIENT_FILE_KEY_AGREEMENT_FAILED) { purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), - _("Key agreement failed")); + _("Error during file transfer"), + _("Key agreement failed"), + purple_request_cpar_from_connection(gc)); } else if (error == SILC_CLIENT_FILE_TIMEOUT) { purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), - _("Connection timed out")); + _("Error during file transfer"), + _("Connection timed out"), + purple_request_cpar_from_connection(gc)); } else if (error == SILC_CLIENT_FILE_CONNECT_FAILED) { purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), - _("Creating connection failed")); + _("Error during file transfer"), + _("Creating connection failed"), + purple_request_cpar_from_connection(gc)); } else if (error == SILC_CLIENT_FILE_UNKNOWN_SESSION) { purple_notify_error(gc, _("Secure File Transfer"), - _("Error during file transfer"), - _("File transfer session does not exist")); + _("Error during file transfer"), + _("File transfer session does not exist"), + purple_request_cpar_from_connection(gc)); } purple_xfer_set_status(xfer->xfer, PURPLE_XFER_STATUS_CANCEL_REMOTE); purple_xfer_update_progress(xfer->xfer); @@ -268,23 +274,26 @@ silcpurple_ftp_request_result(PurpleXfer *x) case SILC_CLIENT_FILE_UNKNOWN_SESSION: purple_notify_error(gc, _("Secure File Transfer"), - _("No file transfer session active"), NULL); + _("No file transfer session active"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_CLIENT_FILE_ALREADY_STARTED: purple_notify_error(gc, _("Secure File Transfer"), - _("File transfer already started"), NULL); + _("File transfer already started"), NULL, + purple_request_cpar_from_connection(gc)); break; case SILC_CLIENT_FILE_KEY_AGREEMENT_FAILED: purple_notify_error(gc, _("Secure File Transfer"), - _("Could not perform key agreement for file transfer"), - NULL); + _("Could not perform key agreement for file transfer"), + NULL, purple_request_cpar_from_connection(gc)); break; default: purple_notify_error(gc, _("Secure File Transfer"), - _("Could not start the file transfer"), NULL); + _("Could not start the file transfer"), NULL, + purple_request_cpar_from_connection(gc)); break; } @@ -421,7 +430,8 @@ silcpurple_ftp_send_file_resolved(SilcClient client, _("User %s is not present in the network"), (const char *)context); purple_notify_error(gc, _("Secure File Transfer"), - _("Cannot send file"), tmp); + _("Cannot send file"), tmp, + purple_request_cpar_from_connection(gc)); g_free(context); return; } diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c index 3f1a6e8ae0..bafb0fdf18 100644 --- a/libpurple/protocols/silc/ops.c +++ b/libpurple/protocols/silc/ops.c @@ -74,7 +74,7 @@ void silc_say(SilcClient client, SilcClientConnection conn, if (gc != NULL) purple_connection_error(gc, reason, tmp); else - purple_notify_error(NULL, _("Error"), _("Error occurred"), tmp); + purple_notify_error(NULL, _("Error"), _("Error occurred"), tmp, NULL); } /* Processes incoming MIME message. Can be private message or channel @@ -830,7 +830,7 @@ silc_notify(SilcClient client, SilcClientConnection conn, SilcStatus error = va_arg(va, int); purple_notify_error(gc, "Error Notify", silc_get_status_message(error), - NULL); + NULL, purple_request_cpar_from_connection(gc)); } break; @@ -1103,7 +1103,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Join Chat"), _("Cannot join channel"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1179,7 +1180,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("User Information"), _("Cannot get user information"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); break; } @@ -1327,7 +1329,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("User Information"), _("Cannot get user information"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); break; } @@ -1386,7 +1389,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Detach From Server"), _("Cannot detach"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1406,7 +1410,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Topic"), _("Cannot set topic"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1435,7 +1440,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Nick"), _("Failed to change nickname"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1473,7 +1479,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (error != SILC_STATUS_OK) { purple_notify_error(gc, _("Error"), _("Error retrieving room list"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); purple_roomlist_set_in_progress(sg->roomlist, FALSE); purple_roomlist_unref(sg->roomlist); sg->roomlist = NULL; @@ -1484,7 +1491,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, name = va_arg(ap, char *); if (!name) { purple_notify_error(gc, _("Roomlist"), _("Cannot get room list"), - _("Network is empty")); + _("Network is empty"), + purple_request_cpar_from_connection(gc)); purple_roomlist_set_in_progress(sg->roomlist, FALSE); purple_roomlist_unref(sg->roomlist); sg->roomlist = NULL; @@ -1517,7 +1525,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Get Public Key"), _("Cannot fetch the public key"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1528,7 +1537,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (!public_key) purple_notify_error(gc, _("Get Public Key"), _("Cannot fetch the public key"), - _("No public key was received")); + _("No public key was received"), + purple_request_cpar_from_connection(gc)); } break; @@ -1542,7 +1552,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Server Information"), _("Cannot get server information"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1553,7 +1564,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (server_name && server_info) { g_snprintf(tmp, sizeof(tmp), "Server: %s\n%s", server_name, server_info); - purple_notify_info(gc, NULL, _("Server Information"), tmp); + purple_notify_info(gc, NULL, _("Server Information"), tmp, + purple_request_cpar_from_connection(gc)); } } break; @@ -1566,7 +1578,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Server Statistics"), _("Cannot get server statistics"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } @@ -1604,7 +1617,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, (int)stats->router_ops); purple_notify_info(gc, NULL, - _("Network Statistics"), msg); + _("Network Statistics"), msg, + purple_request_cpar_from_connection(gc)); g_free(msg); } break; @@ -1613,12 +1627,13 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, { if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Ping"), _("Ping failed"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } purple_notify_info(gc, _("Ping"), _("Ping reply received from server"), - NULL); + NULL, purple_request_cpar_from_connection(gc)); } break; @@ -1626,7 +1641,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("Kill User"), _("Could not kill user"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } break; @@ -1665,7 +1681,8 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, case SILC_COMMAND_WATCH: if (status != SILC_STATUS_OK) { purple_notify_error(gc, _("WATCH"), _("Cannot watch user"), - silc_get_status_message(error)); + silc_get_status_message(error), + purple_request_cpar_from_connection(gc)); return; } break; diff --git a/libpurple/protocols/silc/pk.c b/libpurple/protocols/silc/pk.c index 1ab65e3c6c..bc24e0f183 100644 --- a/libpurple/protocols/silc/pk.c +++ b/libpurple/protocols/silc/pk.c @@ -138,7 +138,8 @@ void silcpurple_verify_public_key(SilcClient client, SilcClientConnection conn, if (silc_pkcs_get_type(public_key) != SILC_PKCS_SILC) { purple_notify_error(gc, _("Verify Public Key"), - _("Unsupported public key type"), NULL); + _("Unsupported public key type"), NULL, + purple_request_cpar_from_connection(gc)); if (completion) completion(FALSE, context); return; diff --git a/libpurple/protocols/silc/silc.c b/libpurple/protocols/silc/silc.c index afab01f0c8..e8ceb3b4f4 100644 --- a/libpurple/protocols/silc/silc.c +++ b/libpurple/protocols/silc/silc.c @@ -472,7 +472,9 @@ static void silcpurple_got_password_cb(PurpleConnection *gc, PurpleRequestFields if (!password || !*password) { - purple_notify_error(gc, NULL, _("Password is required to sign on."), NULL); + purple_notify_error(gc, NULL, + _("Password is required to sign on."), NULL, + purple_request_cpar_from_connection(gc)); purple_connection_set_protocol_data(gc, NULL); silc_free(sg); return; @@ -1099,9 +1101,10 @@ silcpurple_view_motd(PurplePluginAction *action) return; if (!sg->motd) { - purple_notify_error( - gc, _("Message of the Day"), _("No Message of the Day available"), - _("There is no Message of the Day associated with this connection")); + purple_notify_error(gc, _("Message of the Day"), _("No Message " + "of the Day available"), _("There is no Message of the " + "Day associated with this connection"), + purple_request_cpar_from_connection(gc)); return; } @@ -1151,8 +1154,9 @@ silcpurple_create_keypair_cb(PurpleConnection *gc, PurpleRequestFields *fields) pass2 = ""; if (strcmp(pass1, pass2)) { - purple_notify_error( - gc, _("Create New SILC Key Pair"), _("Passphrases do not match"), NULL); + purple_notify_error(gc, _("Create New SILC Key Pair"), + _("Passphrases do not match"), NULL, + purple_request_cpar_from_connection(gc)); return; } @@ -1197,8 +1201,9 @@ silcpurple_create_keypair_cb(PurpleConnection *gc, PurpleRequestFields *fields) if (!silc_create_key_pair(SILCPURPLE_DEF_PKCS, keylen, pkfile, prfile, identifier, pass1, &public_key, NULL, FALSE)) { - purple_notify_error( - gc, _("Create New SILC Key Pair"), _("Key Pair Generation failed"), NULL); + purple_notify_error(gc, _("Create New SILC Key Pair"), + _("Key Pair Generation failed"), NULL, + purple_request_cpar_from_connection(gc)); return; } @@ -1465,7 +1470,8 @@ silcpurple_send_im(PurpleConnection *gc, const char *who, const char *message, if (!silc_client_command_call(client, conn, msg + 1)) purple_notify_error(gc, _("Call Command"), _("Cannot call command"), - _("Unknown command")); + _("Unknown command"), + purple_request_cpar_from_connection(gc)); g_free(tmp); return 0; } diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c index cf9d2ff2b1..3e253f65fd 100644 --- a/libpurple/protocols/yahoo/libymsg.c +++ b/libpurple/protocols/yahoo/libymsg.c @@ -367,7 +367,8 @@ static void yahoo_process_status(PurpleConnection *gc, struct yahoo_packet *pkt) case 16: /* Custom error message */ { char *tmp = yahoo_string_decode(gc, pair->value, TRUE); - purple_notify_error(gc, NULL, tmp, NULL); + purple_notify_error(gc, NULL, tmp, NULL, + purple_request_cpar_from_connection(gc)); g_free(tmp); } break; @@ -939,8 +940,11 @@ static void yahoo_process_sms_message(PurpleConnection *gc, struct yahoo_packet c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sms->from); purple_conversation_write(c, NULL, server_msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); } - else - purple_notify_error(gc, NULL, _("Your SMS was not delivered"), NULL); + else { + purple_notify_error(gc, NULL, + _("Your SMS was not delivered"), NULL, + purple_request_cpar_from_connection(gc)); + } g_free(sms->from); g_free(sms); @@ -1081,7 +1085,8 @@ static void yahoo_process_message(PurpleConnection *gc, struct yahoo_packet *pkt } } else if (pkt->status == 2) { purple_notify_error(gc, NULL, - _("Your Yahoo! message did not get sent."), NULL); + _("Your Yahoo! message did not get sent."), NULL, + purple_request_cpar_from_connection(gc)); } for (l = list; l; l = l->next) { @@ -1187,7 +1192,8 @@ static void yahoo_process_sysmessage(PurpleConnection *gc, struct yahoo_packet * prim = g_strdup_printf(_("Yahoo! system message for %s:"), me?me:purple_connection_get_display_name(gc)); - purple_notify_info(NULL, NULL, prim, msg); + purple_notify_info(NULL, NULL, prim, msg, + purple_request_cpar_from_connection(gc)); g_free(prim); } @@ -1292,7 +1298,8 @@ static void yahoo_buddy_denied_our_add(PurpleConnection *gc, const char *who, co } else notify_msg = g_strdup_printf(_("%s has (retroactively) denied your request to add them to your list."), who); - purple_notify_info(gc, NULL, _("Add buddy rejected"), notify_msg); + purple_notify_info(gc, NULL, _("Add buddy rejected"), notify_msg, + purple_request_cpar_from_connection(gc)); g_free(notify_msg); g_hash_table_remove(yd->friends, who); @@ -2045,8 +2052,9 @@ static void yahoo_process_auth(PurpleConnection *gc, struct yahoo_packet *pkt) "authentication method. You will probably not be able " "to successfully sign on to Yahoo. Check %s for updates."), ((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE)); - purple_notify_error(gc, "", _("Failed Yahoo! Authentication"), - buf); + purple_notify_error(gc, "", + _("Failed Yahoo! Authentication"), buf, + purple_request_cpar_from_connection(gc)); g_free(buf); yahoo_auth16_stage1(gc, seed); /* Can't hurt to try it anyway. */ break; @@ -2329,7 +2337,8 @@ static void yahoo_process_addbuddy(PurpleConnection *gc, struct yahoo_packet *pk buf = g_strdup_printf(_("Unable to add buddy %s to group %s to the server list on account %s."), who, decoded_group, purple_connection_get_display_name(gc)); if (!purple_conv_present_error(who, purple_connection_get_account(gc), buf)) - purple_notify_error(gc, NULL, _("Unable to add buddy to server list"), buf); + purple_notify_error(gc, NULL, _("Unable to add buddy to server list"), buf, + purple_request_cpar_from_connection(gc)); g_free(buf); g_free(decoded_group); g_free(who); diff --git a/libpurple/protocols/yahoo/yahoo_filexfer.c b/libpurple/protocols/yahoo/yahoo_filexfer.c index fc185ffadd..8020cabadb 100644 --- a/libpurple/protocols/yahoo/yahoo_filexfer.c +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c @@ -896,7 +896,8 @@ yahoo_process_filetrans_info_15_got(PurpleHttpConnection *hc, if (!purple_http_response_is_successful(response)) { purple_notify_error(yd->gc, NULL, _("File Transfer Failed"), - _("Unable to get file header.")); + _("Unable to get file header."), + purple_request_cpar_from_connection(yd->gc)); purple_xfer_cancel_remote(xfer); return; } @@ -974,7 +975,8 @@ void yahoo_process_filetrans_info_15(PurpleConnection *gc, struct yahoo_packet * if (!xfer_data->is_relay) { purple_debug_error("yahoo", "Non-relay FT aren't tested yet.\n"); purple_notify_error(gc, NULL, _("File Transfer Failed"), - _("Unsupported method")); + _("Unsupported method"), + purple_request_cpar_from_connection(gc)); purple_xfer_cancel_remote(xfer); } diff --git a/libpurple/protocols/yahoo/yahoochat.c b/libpurple/protocols/yahoo/yahoochat.c index ee695b357f..1c0f1127af 100644 --- a/libpurple/protocols/yahoo/yahoochat.c +++ b/libpurple/protocols/yahoo/yahoochat.c @@ -477,17 +477,26 @@ void yahoo_process_chat_join(PurpleConnection *gc, struct yahoo_packet *pkt) gchar const *failed_to_join = _("Failed to join chat"); switch (atoi(pair->value)) { case 0xFFFFFFFA: /* -6 */ - purple_notify_error(gc, NULL, failed_to_join, _("Unknown room")); + purple_notify_error(gc, NULL, failed_to_join, + _("Unknown room"), + purple_request_cpar_from_connection(gc)); break; case 0xFFFFFFF1: /* -15 */ - purple_notify_error(gc, NULL, failed_to_join, _("Maybe the room is full")); + purple_notify_error(gc, NULL, failed_to_join, + _("Maybe the room is full"), + purple_request_cpar_from_connection(gc)); break; case 0xFFFFFFDD: /* -35 */ - purple_notify_error(gc, NULL, failed_to_join, _("Not available")); + purple_notify_error(gc, NULL, failed_to_join, + _("Not available"), + purple_request_cpar_from_connection(gc)); break; default: purple_notify_error(gc, NULL, failed_to_join, - _("Unknown error. You may need to logout and wait five minutes before being able to rejoin a chatroom")); + _("Unknown error. You may need to " + "logout and wait five minutes before " + "being able to rejoin a chatroom"), + purple_request_cpar_from_connection(gc)); } return; } @@ -750,9 +759,11 @@ void yahoo_process_chat_addinvite(PurpleConnection *gc, struct yahoo_packet *pkt void yahoo_process_chat_goto(PurpleConnection *gc, struct yahoo_packet *pkt) { - if (pkt->status == -1) + if (pkt->status == -1) { purple_notify_error(gc, NULL, _("Failed to join buddy in chat"), - _("Maybe they're not in a chat?")); + _("Maybe they're not in a chat?"), + purple_request_cpar_from_connection(gc)); + } } /* @@ -1383,7 +1394,8 @@ yahoo_roomlist_got(PurpleHttpConnection *http_conn, if (!purple_http_response_is_successful(response)) { purple_notify_error(gc, NULL, _("Unable to connect"), - _("Fetching the room list failed.")); + _("Fetching the room list failed."), + purple_request_cpar_from_connection(gc)); yahoo_roomlist_cleanup(yrl->list, yrl); return; } diff --git a/libpurple/protocols/yahoo/ycht.c b/libpurple/protocols/yahoo/ycht.c index c6dc7b80cd..40acc2cf2e 100644 --- a/libpurple/protocols/yahoo/ycht.c +++ b/libpurple/protocols/yahoo/ycht.c @@ -454,7 +454,9 @@ void ycht_connection_close(YchtConn *ycht) static void ycht_connection_error(YchtConn *ycht, const gchar *error) { - purple_notify_info(ycht->gc, NULL, _("Connection problem with the YCHT server"), error); + purple_notify_info(ycht->gc, NULL, + _("Connection problem with the YCHT server"), error, + purple_request_cpar_from_connection(ycht->gc)); ycht_connection_close(ycht); } diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c index c879ea37b6..c731101fbc 100644 --- a/libpurple/protocols/zephyr/zephyr.c +++ b/libpurple/protocols/zephyr/zephyr.c @@ -753,10 +753,13 @@ static void message_failed(PurpleConnection *gc, ZNotice_t notice, struct sockad { if (g_ascii_strcasecmp(notice.z_class, "message")) { gchar* chat_failed = g_strdup_printf(_("Unable to send to chat %s,%s,%s"),notice.z_class,notice.z_class_inst,notice.z_recipient); - purple_notify_error(gc,"",chat_failed,NULL); + purple_notify_error(gc,"",chat_failed,NULL, + purple_request_cpar_from_connection(gc)); g_free(chat_failed); } else { - purple_notify_error(gc, notice.z_recipient, _("User is offline"), NULL); + purple_notify_error(gc, notice.z_recipient, + _("User is offline"), NULL, + purple_request_cpar_from_connection(gc)); } } @@ -1851,7 +1854,8 @@ static void zephyr_login(PurpleAccount * account) /* XXX don't translate this yet. It could be written better */ /* XXX error messages could be handled with more detail */ purple_notify_error(purple_account_get_connection(account), NULL, - "Unable to subscribe to messages", "Unable to subscribe to initial messages"); + "Unable to subscribe to messages", "Unable to subscribe to initial messages", + purple_request_cpar_from_connection(gc)); return; } @@ -2398,7 +2402,7 @@ static GList *zephyr_chat_info(PurpleConnection * gc) static void zephyr_subscribe_failed(PurpleConnection *gc,char * z_class, char *z_instance, char * z_recipient, char* z_galaxy) { gchar* subscribe_failed = g_strdup_printf(_("Attempt to subscribe to %s,%s,%s failed"), z_class, z_instance,z_recipient); - purple_notify_error(gc,"", subscribe_failed, NULL); + purple_notify_error(gc,"", subscribe_failed, NULL, purple_request_cpar_from_connection(gc)); g_free(subscribe_failed); } @@ -2850,7 +2854,8 @@ static void zephyr_action_get_subs_from_server(PurplePluginAction *action) g_string_free(subout, TRUE); } else { /* XXX fix */ - purple_notify_error(gc,"","tzc doesn't support this action",NULL); + purple_notify_error(gc, "", "tzc doesn't support this action", + NULL, purple_request_cpar_from_connection(gc)); } } diff --git a/libpurple/proxy.c b/libpurple/proxy.c index cdad75f5c9..933c61c26f 100644 --- a/libpurple/proxy.c +++ b/libpurple/proxy.c @@ -2347,7 +2347,10 @@ purple_proxy_connect(void *handle, PurpleAccount *account, (purple_proxy_info_get_host(connect_data->gpi) == NULL || purple_proxy_info_get_port(connect_data->gpi) <= 0)) { - purple_notify_error(NULL, NULL, _("Invalid proxy settings"), _("Either the host name or port number specified for your given proxy type is invalid.")); + purple_notify_error(NULL, NULL, _("Invalid proxy settings"), + _("Either the host name or port number specified for " + "your given proxy type is invalid."), + purple_request_cpar_from_account(account)); purple_proxy_connect_data_destroy(connect_data); return NULL; } @@ -2415,7 +2418,10 @@ purple_proxy_connect_udp(void *handle, PurpleAccount *account, (purple_proxy_info_get_host(connect_data->gpi) == NULL || purple_proxy_info_get_port(connect_data->gpi) <= 0)) { - purple_notify_error(NULL, NULL, _("Invalid proxy settings"), _("Either the host name or port number specified for your given proxy type is invalid.")); + purple_notify_error(NULL, NULL, _("Invalid proxy settings"), + _("Either the host name or port number specified for " + "your given proxy type is invalid."), + purple_request_cpar_from_account(account)); purple_proxy_connect_data_destroy(connect_data); return NULL; } diff --git a/libpurple/xmlnode.c b/libpurple/xmlnode.c index 81285a514f..bee331e85a 100644 --- a/libpurple/xmlnode.c +++ b/libpurple/xmlnode.c @@ -886,7 +886,7 @@ xmlnode_from_file(const char *dir,const char *filename, const char *description, msg = g_strdup_printf(_("An error was encountered reading your " "%s. The file has not been loaded, and the old file " "has been renamed to %s~."), description, filename_full); - purple_notify_error(NULL, NULL, title, msg); + purple_notify_error(NULL, NULL, title, msg, NULL); g_free(title); g_free(msg); } diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c index aa1c21e7ba..2d9bb8755c 100644 --- a/pidgin/gtkaccount.c +++ b/pidgin/gtkaccount.c @@ -1459,7 +1459,7 @@ ok_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) dialog->protocol_id, username); purple_notify_error(NULL, NULL, _("Unable to save new account"), - _("An account already exists with the specified criteria.")); + _("An account already exists with the specified criteria."), NULL); g_free(username); return; diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index c8a64de526..c7246188ea 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -2566,7 +2566,7 @@ static void pidgin_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, { purple_notify_error(NULL, NULL, _("You are not currently signed on with an account that " - "can add that buddy."), NULL); + "can add that buddy."), NULL, NULL); } else { @@ -7473,7 +7473,9 @@ pidgin_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); if (prpl_info->join_chat == NULL) { - purple_notify_error(gc, NULL, _("This protocol does not support chat rooms."), NULL); + purple_notify_error(gc, NULL, _("This protocol does not" + " support chat rooms."), NULL, + purple_request_cpar_from_account(account)); return; } } else { @@ -7491,7 +7493,7 @@ pidgin_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, if (account == NULL) { purple_notify_error(NULL, NULL, _("You are not currently signed on with any " - "protocols that have the ability to chat."), NULL); + "protocols that have the ability to chat."), NULL, NULL); return; } } diff --git a/pidgin/gtkcertmgr.c b/pidgin/gtkcertmgr.c index e13dca538c..b0be037c35 100644 --- a/pidgin/gtkcertmgr.c +++ b/pidgin/gtkcertmgr.c @@ -209,7 +209,7 @@ tls_peers_mgmt_import_ok_cb(gpointer data, const char *filename) purple_notify_error(NULL, _("Certificate Import Error"), _("X.509 certificate import failed"), - secondary); + secondary, NULL); g_free(secondary); } } @@ -244,7 +244,7 @@ tls_peers_mgmt_export_ok_cb(gpointer data, const char *filename) purple_notify_error(NULL, _("Certificate Export Error"), _("X.509 certificate export failed"), - secondary); + secondary, NULL); g_free(secondary); } diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c index 2aac1193b9..95a1e9066d 100644 --- a/pidgin/gtkconv.c +++ b/pidgin/gtkconv.c @@ -880,9 +880,10 @@ invite_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, if (strcmp(convprotocol, purple_account_get_protocol_id(purple_buddy_get_account(buddy)))) { - purple_notify_error(PIDGIN_CONVERSATION(info->conv), NULL, - _("That buddy is not on the same protocol as this " - "chat."), NULL); + purple_notify_error(PIDGIN_CONVERSATION(info->conv), + NULL, _("That buddy is not on the same protocol" + " as this chat."), NULL, + purple_request_cpar_from_conversation(info->conv)); success = FALSE; } else @@ -904,13 +905,16 @@ invite_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, { purple_notify_error(PIDGIN_CONVERSATION(info->conv), NULL, _("You are not currently signed on with an account that " - "can invite that buddy."), NULL); + "can invite that buddy."), NULL, NULL); } else if (strcmp(convprotocol, purple_account_get_protocol_id(account))) { - purple_notify_error(PIDGIN_CONVERSATION(info->conv), NULL, - _("That buddy is not on the same protocol as this " - "chat."), NULL); + purple_notify_error( + PIDGIN_CONVERSATION(info->conv), NULL, + _("That buddy is not on the same " + "protocol as this chat."), NULL, + purple_request_cpar_from_account( + account)); success = FALSE; } else @@ -1076,7 +1080,9 @@ savelog_writefile_cb(void *user_data, const char *filename) gchar *text; if ((fp = g_fopen(filename, "w+")) == NULL) { - purple_notify_error(PIDGIN_CONVERSATION(conv), NULL, _("Unable to open file."), NULL); + purple_notify_error(PIDGIN_CONVERSATION(conv), NULL, + _("Unable to open file."), NULL, + purple_request_cpar_from_conversation(conv)); return; } @@ -2831,7 +2837,7 @@ saveicon_writefile_cb(void *user_data, const char *filename) data = purple_buddy_icon_get_data(icon, &len); if ((len <= 0) || (data == NULL) || !purple_util_write_data_to_file_absolute(filename, data, len)) { - purple_notify_error(gtkconv, NULL, _("Unable to save icon file to disk."), NULL); + purple_notify_error(gtkconv, NULL, _("Unable to save icon file to disk."), NULL, NULL); } } @@ -5617,7 +5623,7 @@ conv_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, { purple_notify_error(win, NULL, _("You are not currently signed on with an account that " - "can add that buddy."), NULL); + "can add that buddy."), NULL, NULL); } else { /* * If a buddy is dragged to a chat window of the same protocol, diff --git a/pidgin/gtkdebug.c b/pidgin/gtkdebug.c index c7f0601f97..f8ce629856 100644 --- a/pidgin/gtkdebug.c +++ b/pidgin/gtkdebug.c @@ -108,7 +108,7 @@ save_writefile_cb(void *user_data, const char *filename) char *tmp; if ((fp = g_fopen(filename, "w+")) == NULL) { - purple_notify_error(win, NULL, _("Unable to open file."), NULL); + purple_notify_error(win, NULL, _("Unable to open file."), NULL, NULL); return; } diff --git a/pidgin/gtkft.c b/pidgin/gtkft.c index 1cbb02eb2e..499cfef499 100644 --- a/pidgin/gtkft.c +++ b/pidgin/gtkft.c @@ -516,7 +516,7 @@ open_button_cb(GtkButton *button, PidginXferDialog *dialog) tmp = g_strdup_printf(_("Error launching %s: %s"), purple_xfer_get_local_filename(dialog->selected_xfer), error->message); - purple_notify_error(dialog, NULL, _("Unable to open file."), tmp); + purple_notify_error(dialog, NULL, _("Unable to open file."), tmp, NULL); g_free(tmp); g_error_free(error); } @@ -525,7 +525,7 @@ open_button_cb(GtkButton *button, PidginXferDialog *dialog) char *primary = g_strdup_printf(_("Error running %s"), command); char *secondary = g_strdup_printf(_("Process returned error code %d"), exit_status); - purple_notify_error(dialog, NULL, primary, secondary); + purple_notify_error(dialog, NULL, primary, secondary, NULL); g_free(tmp); } } diff --git a/pidgin/gtkimhtmltoolbar.c b/pidgin/gtkimhtmltoolbar.c index 5ea3396457..785cc58559 100644 --- a/pidgin/gtkimhtmltoolbar.c +++ b/pidgin/gtkimhtmltoolbar.c @@ -519,7 +519,7 @@ do_insert_image_cb(GtkWidget *widget, int response, GtkIMHtmlToolbar *toolbar) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->image), FALSE); if (!g_file_get_contents(filename, &filedata, &size, &error)) { - purple_notify_error(NULL, NULL, error->message, NULL); + purple_notify_error(NULL, NULL, error->message, NULL, NULL); g_error_free(error); g_free(filename); @@ -533,7 +533,7 @@ do_insert_image_cb(GtkWidget *widget, int response, GtkIMHtmlToolbar *toolbar) if (id == 0) { buf = g_strdup_printf(_("Failed to store image: %s\n"), filename); - purple_notify_error(NULL, NULL, buf, NULL); + purple_notify_error(NULL, NULL, buf, NULL, NULL); g_free(buf); g_free(filename); diff --git a/pidgin/gtklog.c b/pidgin/gtklog.c index aeb58dc22d..ba034906a6 100644 --- a/pidgin/gtklog.c +++ b/pidgin/gtklog.c @@ -245,7 +245,7 @@ static void delete_log_cb(gpointer *data) if (!purple_log_delete((PurpleLog *)data[2])) { purple_notify_error(NULL, NULL, _("Log Deletion Failed"), - _("Check permissions and try again.")); + _("Check permissions and try again."), NULL); } else { @@ -567,7 +567,7 @@ static PidginLogViewer *display_log_viewer(struct log_viewer_hash_t *ht, GList * if(icon != NULL) gtk_widget_destroy(icon); - purple_notify_info(NULL, title, _("No logs were found"), log_preferences); + purple_notify_info(NULL, title, _("No logs were found"), log_preferences, NULL); return NULL; } diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c index e81bf2368e..f15705501a 100644 --- a/pidgin/gtkmedia.c +++ b/pidgin/gtkmedia.c @@ -598,11 +598,13 @@ pidgin_media_error_cb(PidginMedia *media, const char *error, PidginMedia *gtkmed PurpleConversation *conv = purple_find_conversation_with_account( PURPLE_CONV_TYPE_ANY, gtkmedia->priv->screenname, purple_media_get_account(gtkmedia->priv->media)); - if (conv != NULL) + if (conv != NULL) { purple_conversation_write(conv, NULL, error, - PURPLE_MESSAGE_ERROR, time(NULL)); - else - purple_notify_error(NULL, NULL, _("Media error"), error); + PURPLE_MESSAGE_ERROR, time(NULL)); + } else { + purple_notify_error(NULL, NULL, _("Media error"), error, + purple_request_cpar_from_conversation(conv)); + } gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar), 0, error); diff --git a/pidgin/gtknotify.c b/pidgin/gtknotify.c index 14b18764e9..6237d1dbcb 100644 --- a/pidgin/gtknotify.c +++ b/pidgin/gtknotify.c @@ -509,7 +509,8 @@ searchresults_callback_wrapper_cb(GtkWidget *widget, PidginNotifySearchResultsBu static void * pidgin_notify_message(PurpleNotifyMsgType type, const char *title, - const char *primary, const char *secondary) + const char *primary, const char *secondary, + PurpleRequestCommonParameters *cpar) { GtkWidget *dialog; GtkWidget *hbox; @@ -1225,7 +1226,7 @@ uri_command(const char *command, gboolean sync) { tmp = g_strdup_printf(_("The browser command \"%s\" is invalid."), command ? command : "(none)"); - purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); + purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp, NULL); g_free(tmp); } @@ -1237,7 +1238,7 @@ uri_command(const char *command, gboolean sync) { tmp = g_strdup_printf(_("Error launching \"%s\": %s"), command, error->message); - purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); + purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp, NULL); g_free(tmp); g_error_free(error); } @@ -1250,7 +1251,7 @@ uri_command(const char *command, gboolean sync) { tmp = g_strdup_printf(_("Error launching \"%s\": %s"), command, error->message); - purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); + purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp, NULL); g_free(tmp); g_error_free(error); } @@ -1409,8 +1410,8 @@ pidgin_notify_uri(const char *uri) if (web_command == NULL || *web_command == '\0') { purple_notify_error(NULL, NULL, _("Unable to open URL"), - _("The 'Manual' browser command has been " - "chosen, but no command has been set.")); + _("The 'Manual' browser command has been " + "chosen, but no command has been set."), NULL); return NULL; } diff --git a/pidgin/gtkplugin.c b/pidgin/gtkplugin.c index c2a901dc16..fecd7d6e77 100644 --- a/pidgin/gtkplugin.c +++ b/pidgin/gtkplugin.c @@ -327,12 +327,12 @@ static void plugin_toggled_stage_two(PurplePlugin *plug, GtkTreeModel *model, Gt if (!plug->error) { - purple_notify_warning(NULL, NULL, primary, reload); + purple_notify_warning(NULL, NULL, primary, reload, NULL); } else { char *tmp = g_strdup_printf("%s\n\n%s", reload, plug->error); - purple_notify_warning(NULL, NULL, primary, tmp); + purple_notify_warning(NULL, NULL, primary, tmp, NULL); g_free(tmp); } diff --git a/pidgin/gtkpounce.c b/pidgin/gtkpounce.c index b5a93a8bef..2c8d949cca 100644 --- a/pidgin/gtkpounce.c +++ b/pidgin/gtkpounce.c @@ -263,8 +263,8 @@ save_pounce_cb(GtkWidget *w, PidginPounceDialog *dialog) if (*name == '\0') { - purple_notify_error(NULL, NULL, - _("Please enter a buddy to pounce."), NULL); + purple_notify_error(NULL, NULL, _("Please enter a buddy to " + "pounce."), NULL, NULL); return; } @@ -461,7 +461,7 @@ pounce_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, { purple_notify_error(NULL, NULL, _("You are not currently signed on with an account that " - "can add that buddy."), NULL); + "can add that buddy."), NULL, NULL); } else { diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c index 06386ed13a..407e79e5f9 100644 --- a/pidgin/gtkprefs.c +++ b/pidgin/gtkprefs.c @@ -952,7 +952,7 @@ theme_install_theme(char *path, struct theme_info *info) /* Fire! */ if (system(command)) { - purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL); + purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL, NULL); g_free(command); g_free(destdir); free_theme_info(info); @@ -960,7 +960,7 @@ theme_install_theme(char *path, struct theme_info *info) } #else if (!winpidgin_gz_untar(path, destdir)) { - purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL); + purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL, NULL); g_free(destdir); free_theme_info(info); return; @@ -1005,7 +1005,7 @@ theme_install_theme(char *path, struct theme_info *info) } else { /* something was wrong with the theme archive */ g_unlink(destdir); - purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL); + purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL, NULL); } } else { /* just a single file so copy it to a new temp directory and attempt to load it*/ @@ -1053,10 +1053,10 @@ theme_install_theme(char *path, struct theme_info *info) purple_debug_error("gtkprefs", "Error removing %s: %s\n", temp_path, g_strerror(errno)); } - purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL); + purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL, NULL); } } else { - purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL); + purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL, NULL); } g_free(temp_file); @@ -2077,7 +2077,7 @@ proxy_button_clicked_cb(GtkWidget *button, gchar *program) if (g_spawn_command_line_async(program, &err)) return; - purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message); + purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message, NULL); g_error_free(err); } @@ -2090,7 +2090,7 @@ browser_button_clicked_cb(GtkWidget *button, gchar *path) if (g_spawn_command_line_async(path, &err)) return; - purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); + purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message, NULL); g_error_free(err); } #endif @@ -2819,7 +2819,7 @@ keyring_page_pref_set_inuse(GError *error, gpointer _keyring_page_instance) if (error != NULL) { pidgin_prefs_dropdown_revert_active(keyring_combo); purple_notify_error(NULL, _("Keyring"), - _("Failed to set new keyring"), error->message); + _("Failed to set new keyring"), error->message, NULL); return; } @@ -2845,7 +2845,7 @@ keyring_page_pref_changed(GtkComboBox *combo_box, PidginPrefValue value) if (keyring == NULL) { pidgin_prefs_dropdown_revert_active(keyring_combo); purple_notify_error(NULL, _("Keyring"), - _("Selected keyring is disabled"), NULL); + _("Selected keyring is disabled"), NULL, NULL); return; } diff --git a/pidgin/gtksavedstatuses.c b/pidgin/gtksavedstatuses.c index 34c80eeaa4..10a11ddd5c 100644 --- a/pidgin/gtksavedstatuses.c +++ b/pidgin/gtksavedstatuses.c @@ -726,7 +726,7 @@ status_editor_ok_cb(GtkButton *button, gpointer user_data) ((dialog->original_title == NULL) || (strcmp(title, dialog->original_title)))) { purple_notify_error(status_window, NULL, _("Title already in use. You must " - "choose a unique title."), NULL); + "choose a unique title."), NULL, NULL); return; } diff --git a/pidgin/gtksmiley.c b/pidgin/gtksmiley.c index 90db101f1c..c6f1d2afc2 100644 --- a/pidgin/gtksmiley.c +++ b/pidgin/gtksmiley.c @@ -240,7 +240,7 @@ static void do_add(GtkWidget *widget, PidginSmiley *s) msg = g_strdup_printf(_("A custom smiley for '%s' already exists. " "Please use a different shortcut."), entry); purple_notify_error(s->parent, _("Custom Smiley"), - _("Duplicate Shortcut"), msg); + _("Duplicate Shortcut"), msg, NULL); g_free(msg); return; } diff --git a/pidgin/gtksound.c b/pidgin/gtksound.c index a9349bbafb..8b58051558 100644 --- a/pidgin/gtksound.c +++ b/pidgin/gtksound.c @@ -323,7 +323,7 @@ pidgin_sound_init(void) if ((gst_init_failed = !gst_init_check(NULL, NULL, &error))) { purple_notify_error(NULL, _("GStreamer Failure"), _("GStreamer failed to initialize."), - error ? error->message : ""); + error ? error->message : "", NULL); if (error) { g_error_free(error); error = NULL; diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c index 42549819cd..4fe5d1cd69 100644 --- a/pidgin/gtkutils.c +++ b/pidgin/gtkutils.c @@ -1371,8 +1371,7 @@ static void dnd_image_ok_callback(_DndData *data, int choice) str = g_strdup_printf(_("The following error has occurred loading %s: %s"), data->filename, g_strerror(errno)); purple_notify_error(NULL, NULL, - _("Failed to load image"), - str); + _("Failed to load image"), str, NULL); g_free(str); break; @@ -1399,8 +1398,7 @@ static void dnd_image_ok_callback(_DndData *data, int choice) str = g_strdup_printf(_("The following error has occurred loading %s: %s"), data->filename, err->message); purple_notify_error(NULL, NULL, - _("Failed to load image"), - str); + _("Failed to load image"), str, NULL); g_error_free(err); g_free(str); @@ -1476,8 +1474,8 @@ pidgin_dnd_file_manage(GtkSelectionData *sd, PurpleAccount *account, const char str = g_strdup_printf(_("Cannot send folder %s."), basename); str2 = g_strdup_printf(_("%s cannot transfer a folder. You will need to send the files within individually."), PIDGIN_NAME); - purple_notify_error(NULL, NULL, - str, str2); + purple_notify_error(NULL, NULL, str, str2, + purple_request_cpar_from_connection(gc)); g_free(str); g_free(str2); @@ -1589,7 +1587,7 @@ pidgin_dnd_file_manage(GtkSelectionData *sd, PurpleAccount *account, const char _("You dragged a desktop launcher. Most " "likely you wanted to send the target " "of this launcher instead of this " - "launcher itself.")); + "launcher itself."), NULL); break; } purple_desktop_item_unref(item); @@ -2425,7 +2423,7 @@ pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len) tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"), path, plugin->info->name); - purple_notify_error(NULL, _("Icon Error"), _("Could not set icon"), tmp); + purple_notify_error(NULL, _("Icon Error"), _("Could not set icon"), tmp, NULL); g_free(tmp); return NULL; @@ -2608,8 +2606,8 @@ gboolean pidgin_tree_view_search_equal_func(GtkTreeModel *model, gint column, if (g_ascii_strcasecmp(key, "Global Thermonuclear War") == 0) { - purple_notify_info(NULL, "WOPR", - "Wouldn't you prefer a nice game of chess?", NULL); + purple_notify_info(NULL, "WOPR", "Wouldn't you prefer a nice " + "game of chess?", NULL, NULL); return FALSE; } @@ -3253,7 +3251,7 @@ file_open_uri(GtkWebView *webview, const char *uri) { tmp = g_strdup_printf(_("Error launching %s: %s"), uri, error->message); - purple_notify_error(webview, NULL, _("Unable to open file."), tmp); + purple_notify_error(webview, NULL, _("Unable to open file."), tmp, NULL); g_free(tmp); g_error_free(error); } @@ -3262,7 +3260,7 @@ file_open_uri(GtkWebView *webview, const char *uri) char *primary = g_strdup_printf(_("Error running %s"), command); char *secondary = g_strdup_printf(_("Process returned error code %d"), exit_status); - purple_notify_error(webview, NULL, primary, secondary); + purple_notify_error(webview, NULL, primary, secondary, NULL); g_free(tmp); } } diff --git a/pidgin/gtkwebviewtoolbar.c b/pidgin/gtkwebviewtoolbar.c index 89124527ff..8c8eaf8151 100644 --- a/pidgin/gtkwebviewtoolbar.c +++ b/pidgin/gtkwebviewtoolbar.c @@ -565,7 +565,7 @@ do_insert_image_cb(GtkWidget *widget, int response, GtkWebViewToolbar *toolbar) return; if (!g_file_get_contents(filename, &filedata, &size, &error)) { - purple_notify_error(NULL, NULL, error->message, NULL); + purple_notify_error(NULL, NULL, error->message, NULL, NULL); g_error_free(error); g_free(filename); @@ -579,7 +579,7 @@ do_insert_image_cb(GtkWidget *widget, int response, GtkWebViewToolbar *toolbar) if (id == 0) { buf = g_strdup_printf(_("Failed to store image: %s\n"), filename); - purple_notify_error(NULL, NULL, buf, NULL); + purple_notify_error(NULL, NULL, buf, NULL, NULL); g_free(buf); g_free(filename); diff --git a/pidgin/plugins/disco/gtkdisco.c b/pidgin/plugins/disco/gtkdisco.c index fc1b5afecb..559b789ce7 100644 --- a/pidgin/plugins/disco/gtkdisco.c +++ b/pidgin/plugins/disco/gtkdisco.c @@ -175,7 +175,7 @@ static void discolist_ok_cb(PidginDiscoList *pdl, const char *server) if (!server || !*server) { purple_notify_error(my_plugin, _("Invalid Server"), _("Invalid Server"), - NULL); + NULL, purple_request_cpar_from_connection(pdl->pc)); pidgin_disco_list_set_in_progress(pdl, FALSE); pidgin_disco_list_unref(pdl); diff --git a/pidgin/plugins/disco/xmppdisco.c b/pidgin/plugins/disco/xmppdisco.c index ccadd0c281..e40dab08bb 100644 --- a/pidgin/plugins/disco/xmppdisco.c +++ b/pidgin/plugins/disco/xmppdisco.c @@ -513,12 +513,12 @@ server_info_cb(PurpleConnection *pc, const char *type, const char *id, || xmlnode_get_child(error, "jid-malformed")) { purple_notify_error(my_plugin, _("Error"), _("Server does not exist"), - NULL); + NULL, NULL); } else { purple_notify_error(my_plugin, _("Error"), _("Server does not support service discovery"), - NULL); + NULL, NULL); } pidgin_disco_list_set_in_progress(list, FALSE); g_free(cb_data); diff --git a/pidgin/plugins/history.c b/pidgin/plugins/history.c index f2d1d913d0..f0ebdd8614 100644 --- a/pidgin/plugins/history.c +++ b/pidgin/plugins/history.c @@ -182,7 +182,7 @@ history_prefs_check(PurplePlugin *plugin) purple_notify_warning(plugin, NULL, _("History Plugin Requires Logging"), _("Logging can be enabled from Tools -> Preferences -> Logging.\n\n" "Enabling logs for instant messages and/or chats will activate " - "history for the same conversation type(s).")); + "history for the same conversation type(s)."), NULL); } } diff --git a/pidgin/plugins/musicmessaging/musicmessaging.c b/pidgin/plugins/musicmessaging/musicmessaging.c index dd157d0262..dc5017bc9c 100644 --- a/pidgin/plugins/musicmessaging/musicmessaging.c +++ b/pidgin/plugins/musicmessaging/musicmessaging.c @@ -145,7 +145,7 @@ void music_messaging_change_failed(const int session, const char *id, const char MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session); purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_INFO, command, - parameters, NULL, NULL, NULL); + parameters, NULL, NULL, NULL, NULL); if (mmconv->started) { @@ -167,7 +167,7 @@ void music_messaging_done_session(const int session) MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session); purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_INFO, "Session", - "Session Complete", NULL, NULL, NULL); + "Session Complete", NULL, NULL, NULL, NULL); session_end(mmconv); } @@ -429,7 +429,7 @@ intercept_received(PurpleAccount *account, char **sender, char **message, Purple { purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_ERROR, _("Music Messaging"), - _("There was a conflict in running the command:"), command, NULL, NULL); + _("There was a conflict in running the command:"), command, NULL, NULL, NULL); } } } @@ -538,7 +538,7 @@ static void run_editor (MMConversation *mmconv) if (!(g_spawn_async (".", args, NULL, 4, NULL, NULL, &(mmconv->pid), &spawn_error))) { purple_notify_error(plugin_pointer, _("Error Running Editor"), - _("The following error has occurred:"), spawn_error->message); + _("The following error has occurred:"), spawn_error->message, NULL); mmconv->started = FALSE; } else diff --git a/pidgin/plugins/spellchk.c b/pidgin/plugins/spellchk.c index 11b0f6df33..4ba6c185fb 100644 --- a/pidgin/plugins/spellchk.c +++ b/pidgin/plugins/spellchk.c @@ -1974,7 +1974,7 @@ static void list_add_new(void) purple_notify_error(NULL, _("Duplicate Correction"), _("The specified word already exists in the correction list."), - gtk_entry_get_text(GTK_ENTRY(bad_entry))); + gtk_entry_get_text(GTK_ENTRY(bad_entry)), NULL); return; } |