--- a/pidgin/gtkaccount.c Fri Jan 08 06:05:16 2021 -0600
+++ b/pidgin/gtkaccount.c Mon Jan 11 00:03:41 2021 -0600
@@ -1583,13 +1583,10 @@
-pidgin_account_dialog_show_continue(GObject *obj, GAsyncResult *res,
+pidgin_account_dialog_show_continue(PidginAccountDialogType type, + PurpleAccount *account, - PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(obj);
- PidginAccountDialogShowData *d = (PidginAccountDialogShowData *)data;
- PurpleAccount *account = NULL;
- PidginAccountDialogType type = 0;
AccountPrefsDialog *dialog;
@@ -1597,14 +1594,6 @@
- gchar *password = NULL;
- /* we needed a struct to pass multiple pointers to here, but now that we
- * have them, we can free it.
if (accounts_window != NULL && account != NULL &&
(dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL)
@@ -1615,16 +1604,14 @@
dialog = g_new0(AccountPrefsDialog, 1);
/* Select the first protocol in the list*/
GList *protocol_list = purple_protocols_get_all();
if (protocol_list != NULL) {
dialog->protocol_id = g_strdup(purple_protocol_get_id(PURPLE_PROTOCOL(protocol_list->data)));
g_list_free(protocol_list);
g_strdup(purple_account_get_protocol_id(account));
@@ -1641,12 +1628,8 @@
g_hash_table_insert(account_pref_wins, account, dialog);
- /* The dialog will take ownership of this pointer */
- password = purple_credential_manager_read_password_finish(manager, res,
dialog->account = account;
- dialog->password = password;
+ dialog->password = g_strdup(password); dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
dialog->protocol = purple_protocols_find(dialog->protocol_id);
@@ -1730,6 +1713,23 @@
gtk_widget_grab_focus(dialog->protocol_menu);
+pidgin_account_dialog_read_password_cb(GObject *obj, GAsyncResult *res, + PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(obj); + PidginAccountDialogShowData *d = (PidginAccountDialogShowData *)data; + password = purple_credential_manager_read_password_finish(manager, res, + pidgin_account_dialog_show_continue(d->type, d->account, password); pidgin_account_dialog_show(PidginAccountDialogType type, PurpleAccount *account)
@@ -1745,10 +1745,13 @@
manager = purple_credential_manager_get_default();
- /* this is to make sure the password will be cached */
- purple_credential_manager_read_password_async(manager, account, NULL,
- pidgin_account_dialog_show_continue,
+ if(PURPLE_IS_ACCOUNT(account)) { + purple_credential_manager_read_password_async(manager, account, NULL, + pidgin_account_dialog_read_password_cb, + pidgin_account_dialog_show_continue(type, account, NULL); /**************************************************************************