pidgin/pidgin

Remove the deprecated keyring API.

7 months ago, Gary Kramlich
32c1f097d4e8
Parents da09b67f08ab
Children 1f54363a79f2
Remove the deprecated keyring API.

I've disable the building of the internal keyring for now but left it so it
can be referenced when it is ported to the CredentialProvider API.

Testing Done:
Ran Pidgin and verified the preferences window worked.

Bugs closed: PIDGIN-17486

Reviewed at https://reviews.imfreedom.org/r/624/
--- a/finch/gntprefs.c Mon Apr 19 20:55:45 2021 -0500
+++ b/finch/gntprefs.c Wed Apr 21 18:43:42 2021 -0500
@@ -36,7 +36,6 @@
GList *freestrings; /* strings to be freed when the pref-window is closed */
gboolean showing;
GntWidget *window;
- GntWidget *keyring_window;
} pref_request;
void finch_prefs_init()
@@ -193,12 +192,6 @@
{PURPLE_PREF_NONE, NULL, NULL, NULL},
};
-static Prefs keyring[] =
-{
- {PURPLE_PREF_STRING, "/purple/keyring/active", N_("Active keyring"), purple_keyring_get_options},
- {PURPLE_PREF_NONE, NULL, NULL, NULL}
-};
-
static Prefs idle[] =
{
{PURPLE_PREF_STRING, "/purple/away/idle_reporting", N_("Report Idle time"), get_idle_options},
@@ -249,15 +242,10 @@
return;
}
- if (pref_request.keyring_window != NULL)
- purple_request_close(PURPLE_REQUEST_FIELDS,
- pref_request.keyring_window);
-
fields = purple_request_fields_new();
add_pref_group(fields, _("Buddy List"), blist);
add_pref_group(fields, _("Conversations"), convs);
- add_pref_group(fields, _("Keyring"), keyring);
add_pref_group(fields, _("Logging"), logging);
add_pref_group(fields, _("Idle"), idle);
@@ -266,45 +254,3 @@
_("Save"), G_CALLBACK(save_cb), _("Cancel"), free_strings,
NULL, NULL);
}
-
-static void
-finch_prefs_keyring_save(void *data, PurpleRequestFields *fields)
-{
- PurpleCredentialManager *manager = purple_credential_manager_get_default();
-
- pref_request.keyring_window = NULL;
-
- purple_credential_manager_write_settings(manager, fields, NULL);
-}
-
-static void
-finch_prefs_keyring_cancel(void)
-{
- pref_request.keyring_window = NULL;
-}
-
-void finch_prefs_show_keyring(void)
-{
- PurpleRequestFields *fields;
- PurpleCredentialManager *manager = NULL;
-
- if (pref_request.keyring_window != NULL) {
- gnt_window_present(pref_request.keyring_window);
- return;
- }
-
- manager = purple_credential_manager_get_default();
- fields = purple_credential_manager_read_settings(manager, NULL);
- if (fields == NULL) {
- purple_notify_info(NULL, _("Keyring settings"),
- _("Selected keyring doesn't allow any configuration"),
- NULL, NULL);
- return;
- }
-
- pref_request.keyring_window = purple_request_fields(NULL,
- _("Keyring settings"), NULL, NULL, fields,
- _("Save"), G_CALLBACK(finch_prefs_keyring_save),
- _("Cancel"), G_CALLBACK(finch_prefs_keyring_cancel),
- NULL, NULL);
-}
--- a/finch/gntprefs.h Mon Apr 19 20:55:45 2021 -0500
+++ b/finch/gntprefs.h Wed Apr 21 18:43:42 2021 -0500
@@ -53,13 +53,6 @@
void finch_prefs_show_all(void);
/**
- * finch_prefs_show_keyring:
- *
- * Show the preferences dialog for the selected keyring.
- */
-void finch_prefs_show_keyring(void);
-
-/**
* finch_prefs_update_old:
*
* You don't need to know about this.
--- a/finch/gntui.c Mon Apr 19 20:55:45 2021 -0500
+++ b/finch/gntui.c Wed Apr 21 18:43:42 2021 -0500
@@ -100,7 +100,6 @@
gnt_register_action(_("Plugins"), finch_plugins_show_all);
gnt_register_action(_("Room List"), finch_roomlist_show_all);
gnt_register_action(_("Preferences"), finch_prefs_show_all);
- gnt_register_action(_("Keyring settings"), finch_prefs_show_keyring);
gnt_register_action(_("Statuses"), finch_savedstatus_show_all);
#ifdef STANDALONE
--- a/libpurple/account.c Mon Apr 19 20:55:45 2021 -0500
+++ b/libpurple/account.c Wed Apr 21 18:43:42 2021 -0500
@@ -841,35 +841,6 @@
child = purple_xmlnode_new_child(node, "name");
purple_xmlnode_insert_data(child, purple_account_get_username(account), -1);
- if (purple_account_get_remember_password(account))
- {
- const char *keyring_id = NULL;
- const char *mode = NULL;
- char *data = NULL;
- GError *error = NULL;
- GDestroyNotify destroy = NULL;
- gboolean exported = purple_keyring_export_password(account,
- &keyring_id, &mode, &data, &error, &destroy);
-
- if (error != NULL) {
- purple_debug_error("account",
- "Failed to export password for account %s: %s.\n",
- purple_account_get_username(account),
- error->message);
- } else if (exported) {
- child = purple_xmlnode_new_child(node, "password");
- if (keyring_id != NULL)
- purple_xmlnode_set_attrib(child, "keyring_id", keyring_id);
- if (mode != NULL)
- purple_xmlnode_set_attrib(child, "mode", mode);
- if (data != NULL)
- purple_xmlnode_insert_data(child, data, -1);
-
- if (destroy != NULL)
- destroy(data);
- }
- }
-
if ((tmp = purple_account_get_private_alias(account)) != NULL)
{
child = purple_xmlnode_new_child(node, "alias");
--- a/libpurple/account.h Mon Apr 19 20:55:45 2021 -0500
+++ b/libpurple/account.h Wed Apr 21 18:43:42 2021 -0500
@@ -59,7 +59,6 @@
#include "proxy.h"
#include "protocol.h"
#include "status.h"
-#include "keyring.h"
#include "xmlnode.h"
/**
--- a/libpurple/accounts.c Mon Apr 19 20:55:45 2021 -0500
+++ b/libpurple/accounts.c Wed Apr 21 18:43:42 2021 -0500
@@ -500,25 +500,6 @@
parse_current_error(child, ret);
}
- /* Read the password */
- child = purple_xmlnode_get_child(node, "password");
- if (child != NULL)
- {
- const char *keyring_id = purple_xmlnode_get_attrib(child, "keyring_id");
- const char *mode = purple_xmlnode_get_attrib(child, "mode");
- gboolean result;
-
- data = purple_xmlnode_get_data(child);
- result = purple_keyring_import_password(ret, keyring_id, mode, data, NULL);
-
- if (result == TRUE || purple_keyring_get_inuse() == NULL) {
- purple_account_set_remember_password(ret, TRUE);
- } else {
- purple_debug_error("accounts", "Failed to import password.\n");
- }
- purple_str_wipe(data);
- }
-
return ret;
}
@@ -874,14 +855,6 @@
account, type, description);
}
-static void
-password_migration_cb(PurpleAccount *account)
-{
- /* account may be NULL (means: all) */
-
- purple_accounts_schedule_save();
-}
-
void
purple_accounts_init(void)
{
@@ -980,8 +953,6 @@
PURPLE_CALLBACK(signed_off_cb), NULL);
purple_signal_connect(conn_handle, "connection-error", handle,
PURPLE_CALLBACK(connection_error_cb), NULL);
- purple_signal_connect(purple_keyring_get_handle(), "password-migration", handle,
- PURPLE_CALLBACK(password_migration_cb), NULL);
load_accounts();
--- a/libpurple/core.c Mon Apr 19 20:55:45 2021 -0500
+++ b/libpurple/core.c Wed Apr 21 18:43:42 2021 -0500
@@ -29,7 +29,6 @@
#include "xfer.h"
#include "idle.h"
#include "image-store.h"
-#include "keyring.h"
#include "network.h"
#include "notify.h"
#include "plugins.h"
@@ -157,7 +156,6 @@
*/
purple_plugins_init();
- purple_keyring_init(); /* before accounts */
purple_theme_manager_init();
/* The buddy icon code uses the image store, so init it early. */
@@ -236,7 +234,6 @@
purple_savedstatuses_uninit();
purple_statuses_uninit();
purple_accounts_uninit();
- purple_keyring_uninit(); /* after accounts */
purple_theme_manager_uninit();
purple_xfers_uninit();
purple_proxy_uninit();
--- a/libpurple/keyring.c Mon Apr 19 20:55:45 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1191 +0,0 @@
-/* purple
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program ; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- */
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-
-#include <string.h>
-#include "account.h"
-#include "keyring.h"
-#include "signals.h"
-#include "core.h"
-#include "debug.h"
-#include "internal.h"
-#include "plugins.h"
-
-struct _PurpleKeyring
-{
- gchar *name;
- gchar *id;
- PurpleKeyringRead read_password;
- PurpleKeyringSave save_password;
- PurpleKeyringCancelRequests cancel_requests;
- PurpleKeyringClose close_keyring;
- PurpleKeyringImportPassword import_password;
- PurpleKeyringExportPassword export_password;
- PurpleKeyringReadSettings read_settings;
- PurpleKeyringApplySettings apply_settings;
-
- gboolean is_closing;
- gboolean is_cancelling;
- gboolean close_after_cancel;
-};
-
-typedef struct
-{
- GError *error;
- PurpleKeyringSetInUseCallback cb;
- gpointer cb_data;
- PurpleKeyring *new_kr;
- PurpleKeyring *old_kr;
-
- /*
- * We are done when finished is positive and read_outstanding is zero.
- */
- gboolean finished;
- int read_outstanding;
-
- gboolean abort;
- gboolean force;
- gboolean succeeded;
-} PurpleKeyringChangeTracker;
-
-typedef void (*PurpleKeyringDropCallback)(gpointer data);
-
-typedef struct
-{
- PurpleKeyringDropCallback cb;
- gpointer cb_data;
-
- gboolean finished;
- int drop_outstanding;
-} PurpleKeyringDropTracker;
-
-typedef struct
-{
- PurpleKeyringSaveCallback cb;
- gpointer cb_data;
-} PurpleKeyringSetPasswordData;
-
-typedef struct
-{
- gchar *keyring_id;
- gchar *mode;
- gchar *data;
-} PurpleKeyringFailedImport;
-
-static void
-purple_keyring_change_tracker_free(PurpleKeyringChangeTracker *tracker)
-{
- if (tracker->error)
- g_error_free(tracker->error);
- g_free(tracker);
-}
-
-static void
-purple_keyring_failed_import_free(PurpleKeyringFailedImport *import)
-{
- g_return_if_fail(import != NULL);
-
- g_free(import->keyring_id);
- g_free(import->mode);
- purple_str_wipe(import->data);
- g_free(import);
-}
-
-static void
-purple_keyring_close(PurpleKeyring *keyring);
-
-static void
-purple_keyring_drop_passwords(PurpleKeyring *keyring,
- PurpleKeyringDropCallback cb, gpointer data);
-
-/* A list of available keyrings */
-static GList *purple_keyring_keyrings = NULL;
-
-/* Keyring being used. */
-static PurpleKeyring *purple_keyring_inuse = NULL;
-
-/* Keyring id marked to use (may not be loadable). */
-static gchar *purple_keyring_to_use = NULL;
-
-static guint purple_keyring_pref_cbid = 0;
-static GList *purple_keyring_loaded_plugins = NULL;
-static PurpleKeyringChangeTracker *current_change_tracker = NULL;
-static gboolean purple_keyring_is_quitting = FALSE;
-static GHashTable *purple_keyring_failed_imports = NULL;
-
-static const gchar *
-purple_keyring_print_account(PurpleAccount *account)
-{
- static gchar print_buff[100];
-
- if (account == NULL) {
- g_snprintf(print_buff, 100, "(null)");
- return print_buff;
- }
-
- g_snprintf(print_buff, 100, "%s:%s",
- purple_account_get_protocol_id(account),
- purple_account_get_username(account));
- return print_buff;
-}
-
-/**************************************************************************/
-/* Setting used keyrings */
-/**************************************************************************/
-
-PurpleKeyring *
-purple_keyring_find_keyring_by_id(const gchar *id)
-{
- GList *it;
-
- for (it = purple_keyring_keyrings; it != NULL; it = it->next) {
- PurpleKeyring *keyring = it->data;
- const gchar *curr_id = purple_keyring_get_id(keyring);
-
- if (g_strcmp0(id, curr_id) == 0)
- return keyring;
- }
-
- return NULL;
-}
-
-static void
-purple_keyring_pref_callback(const gchar *pref, PurplePrefType type,
- gconstpointer id, gpointer data)
-{
- PurpleKeyring *new_keyring;
-
- g_return_if_fail(g_strcmp0(pref, "/purple/keyring/active") == 0);
- g_return_if_fail(type == PURPLE_PREF_STRING);
- g_return_if_fail(id != NULL);
-
- new_keyring = purple_keyring_find_keyring_by_id(id);
- g_return_if_fail(new_keyring != NULL);
-
- purple_keyring_set_inuse(new_keyring, FALSE, NULL, NULL);
-}
-
-static void
-purple_keyring_pref_connect(void)
-{
- g_return_if_fail(purple_keyring_pref_cbid == 0);
-
- purple_keyring_pref_cbid = purple_prefs_connect_callback(NULL,
- "/purple/keyring/active", purple_keyring_pref_callback, NULL);
-}
-
-static void
-purple_keyring_pref_disconnect(void)
-{
- g_return_if_fail(purple_keyring_pref_cbid != 0);
-
- purple_prefs_disconnect_callback(purple_keyring_pref_cbid);
- purple_keyring_pref_cbid = 0;
-}
-
-PurpleKeyring *
-purple_keyring_get_inuse(void)
-{
- return purple_keyring_inuse;
-}
-
-static void
-purple_keyring_set_inuse_drop_cb(gpointer _tracker)
-{
- PurpleKeyringChangeTracker *tracker = _tracker;
-
- g_return_if_fail(tracker != NULL);
-
- if (tracker->succeeded) {
- purple_keyring_close(tracker->old_kr);
-
- purple_debug_info("keyring", "Successfully changed keyring.\n");
-
- purple_keyring_inuse = tracker->new_kr;
- current_change_tracker = NULL;
-
- if (tracker->cb != NULL)
- tracker->cb(NULL, tracker->cb_data);
- purple_keyring_change_tracker_free(tracker);
- return;
- }
-
- purple_debug_error("keyring", "Failed to change keyring, aborting.\n");
-
- purple_keyring_close(tracker->new_kr);
-
- purple_keyring_pref_disconnect();
- purple_prefs_set_string("/purple/keyring/active",
- purple_keyring_get_id(tracker->old_kr));
- purple_keyring_pref_connect();
-
- current_change_tracker = NULL;
-
- if (tracker->error == NULL) {
- tracker->error = g_error_new_literal(
- PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_UNKNOWN,
- _("An unknown error has occured."));
- }
-
- if (tracker->cb != NULL)
- tracker->cb(tracker->error, tracker->cb_data);
-
- purple_keyring_change_tracker_free(tracker);
-}
-
-static void
-purple_keyring_set_inuse_save_cb(PurpleAccount *account, GError *error,
- gpointer _tracker)
-{
- PurpleKeyringChangeTracker *tracker = _tracker;
-
- g_return_if_fail(account != NULL);
- g_return_if_fail(tracker != NULL);
-
- tracker->read_outstanding--;
-
- if (error == NULL) {
- /* no error */
- } else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
- PURPLE_KEYRING_ERROR_NOPASSWORD))
- {
- if (purple_debug_is_verbose()) {
- purple_debug_misc("keyring", "No password found while "
- "changing keyring for account %s: %s.\n",
- purple_keyring_print_account(account),
- error->message);
- }
- } else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
- PURPLE_KEYRING_ERROR_ACCESSDENIED))
- {
- purple_debug_info("keyring", "Access denied while changing "
- "keyring for account %s: %s.\n",
- purple_keyring_print_account(account), error->message);
- tracker->abort = TRUE;
- if (tracker->error != NULL)
- g_error_free(tracker->error);
- tracker->error = g_error_copy(error);
- } else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
- PURPLE_KEYRING_ERROR_CANCELLED))
- {
- purple_debug_info("keyring", "Operation cancelled while "
- "changing keyring for account %s: %s.\n",
- purple_keyring_print_account(account), error->message);
- tracker->abort = TRUE;
- if (tracker->error == NULL)
- tracker->error = g_error_copy(error);
- } else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
- PURPLE_KEYRING_ERROR_BACKENDFAIL))
- {
- purple_debug_error("keyring", "Failed to communicate with "
- "backend while changing keyring for account %s: %s. "
- "Aborting changes.\n",
- purple_keyring_print_account(account), error->message);
- tracker->abort = TRUE;
- if (tracker->error != NULL)
- g_error_free(tracker->error);
- tracker->error = g_error_copy(error);
- } else {
- purple_debug_error("keyring", "Unknown error while changing "
- "keyring for account %s: %s. Aborting changes.\n",
- purple_keyring_print_account(account), error->message);
- tracker->abort = TRUE;
- if (tracker->error == NULL)
- tracker->error = g_error_copy(error);
- }
-
- purple_signal_emit(purple_keyring_get_handle(), "password-migration",
- account);
-
- if (!tracker->finished || tracker->read_outstanding > 0)
- return;
-
- /* This was the last one. */
- if (tracker->abort && !tracker->force) {
- tracker->succeeded = FALSE;
- purple_keyring_drop_passwords(tracker->new_kr,
- purple_keyring_set_inuse_drop_cb, tracker);
- } else {
- tracker->succeeded = TRUE;
- purple_keyring_drop_passwords(tracker->old_kr,
- purple_keyring_set_inuse_drop_cb, tracker);
- }
-}
-
-static void
-purple_keyring_set_inuse_read_cb(PurpleAccount *account, const gchar *password,
- GError *error, gpointer _tracker)
-{
- PurpleKeyringChangeTracker *tracker = _tracker;
- PurpleKeyringSave save_cb;
-
- g_return_if_fail(account != NULL);
- g_return_if_fail(tracker != NULL);
-
- if (tracker->abort) {
- purple_keyring_set_inuse_save_cb(account, NULL, tracker);
- return;
- }
-
- if (error != NULL) {
- if (tracker->force == TRUE || g_error_matches(error,
- PURPLE_KEYRING_ERROR,
- PURPLE_KEYRING_ERROR_NOPASSWORD))
- {
- /* Don't save password, and ignore it. */
- } else {
- tracker->abort = TRUE;
- }
- purple_keyring_set_inuse_save_cb(account, error, tracker);
- return;
- }
-
- save_cb = purple_keyring_get_save_password(tracker->new_kr);
- g_assert(save_cb != NULL);
-
- save_cb(account, password, purple_keyring_set_inuse_save_cb, tracker);
-}
-
-void
-purple_keyring_set_inuse(PurpleKeyring *newkeyring, gboolean force,
- PurpleKeyringSetInUseCallback cb, gpointer data)
-{
- PurpleKeyring *oldkeyring;
- PurpleKeyringChangeTracker *tracker;
- GList *it;
- PurpleKeyringRead read_cb;
-
- if (current_change_tracker != NULL) {
- GError *error;
- purple_debug_error("keyring", "There is password migration "
- "session already running.\n");
- if (cb == NULL)
- return;
- error = g_error_new_literal(
- PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_INTERNAL,
- _("There is a password migration session already "
- "running."));
- cb(error, data);
- g_error_free(error);
- return;
- }
-
- oldkeyring = purple_keyring_get_inuse();
-
- if (oldkeyring == newkeyring) {
- if (purple_debug_is_verbose()) {
- purple_debug_misc("keyring",
- "Old and new keyring are the same: %s.\n",
- (newkeyring != NULL) ?
- newkeyring->id : "(null)");
- }
- if (cb != NULL)
- cb(NULL, data);
- return;
- }
-
- purple_debug_info("keyring", "Attempting to set new keyring: %s.\n",
- (newkeyring != NULL) ? newkeyring->id : "(null)");
-
- if (oldkeyring == NULL) { /* No keyring was set before. */
- if (purple_debug_is_verbose()) {
- purple_debug_misc("keyring",
- "Setting keyring for the first time: %s.\n",
- (newkeyring != NULL) ? newkeyring->id : "(null)");
- }
-
- purple_keyring_inuse = newkeyring;
- g_assert(current_change_tracker == NULL);
- if (cb != NULL)
- cb(NULL, data);
- return;
- }
-
- /* Starting a migration. */
-
- read_cb = purple_keyring_get_read_password(oldkeyring);
- g_assert(read_cb != NULL);
-
- purple_debug_misc("keyring", "Starting migration from: %s.\n",
- oldkeyring->id);
-
- tracker = g_new0(PurpleKeyringChangeTracker, 1);
- current_change_tracker = tracker;
-
- tracker->cb = cb;
- tracker->cb_data = data;
- tracker->new_kr = newkeyring;
- tracker->old_kr = oldkeyring;
- tracker->force = force;
-
- for (it = purple_accounts_get_all(); it != NULL; it = it->next) {
- if (tracker->abort) {
- tracker->finished = TRUE;
- break;
- }
- tracker->read_outstanding++;
-
- if (it->next == NULL)
- tracker->finished = TRUE;
-
- read_cb(it->data, purple_keyring_set_inuse_read_cb, tracker);
- }
-}
-
-void
-purple_keyring_register(PurpleKeyring *keyring)
-{
- const gchar *keyring_id;
-
- g_return_if_fail(keyring != NULL);
-
- keyring_id = purple_keyring_get_id(keyring);
-
- purple_debug_info("keyring", "Registering keyring: %s\n",
- keyring_id ? keyring_id : "(null)");
-
- if (purple_keyring_get_id(keyring) == NULL ||
- purple_keyring_get_name(keyring) == NULL ||
- purple_keyring_get_read_password(keyring) == NULL ||
- purple_keyring_get_save_password(keyring) == NULL)
- {
- purple_debug_error("keyring", "Cannot register %s, some "
- "required fields are missing.\n",
- keyring_id ? keyring_id : "(null)");
- return;
- }
-
- if (purple_keyring_find_keyring_by_id(keyring_id) != NULL) {
- purple_debug_error("keyring",
- "Keyring is already registered.\n");
- return;
- }
-
- /* If this is the configured keyring, use it. */
- if (purple_keyring_inuse == NULL &&
- g_strcmp0(keyring_id, purple_keyring_to_use) == 0)
- {
- purple_debug_misc("keyring", "Keyring %s matches keyring to "
- "use, using it.", keyring_id);
- purple_keyring_set_inuse(keyring, TRUE, NULL, NULL);
- }
-
- purple_signal_emit(purple_keyring_get_handle(), "keyring-register",
- keyring_id, keyring);
- if (purple_debug_is_verbose()) {
- purple_debug_info("keyring", "Registered keyring: %s.\n",
- keyring_id);
- }
-
- purple_keyring_keyrings = g_list_prepend(purple_keyring_keyrings,
- keyring);
-}
-
-void
-purple_keyring_unregister(PurpleKeyring *keyring)
-{
- PurpleKeyring *inuse;
- PurpleKeyring *fallback;
- const gchar *keyring_id;
-
- g_return_if_fail(keyring != NULL);
-
- keyring_id = purple_keyring_get_id(keyring);
-
- purple_debug_info("keyring", "Unregistering keyring: %s.\n",
- keyring_id);
-
- purple_signal_emit(purple_keyring_get_handle(), "keyring-unregister",
- keyring_id, keyring);
-
- inuse = purple_keyring_get_inuse();
- fallback = purple_keyring_find_keyring_by_id(PURPLE_DEFAULT_KEYRING);
-
- if (inuse == keyring) {
- if (inuse != fallback) {
- purple_keyring_set_inuse(fallback, TRUE, NULL, NULL);
- } else {
- fallback = NULL;
- purple_keyring_set_inuse(NULL, TRUE, NULL, NULL);
- }
- }
-
- purple_keyring_keyrings = g_list_remove(purple_keyring_keyrings,
- keyring);
-}
-
-GList *
-purple_keyring_get_options(void)
-{
- GList *options = NULL;
- GList *it;
- static gchar currentDisabledName[40];
-
- if (purple_keyring_get_inuse() == NULL && purple_keyring_to_use != NULL
- && purple_keyring_to_use[0] != '\0')
- {
- g_snprintf(currentDisabledName, sizeof(currentDisabledName),
- _("%s (disabled)"), purple_keyring_to_use);
-
- options = g_list_append(options, currentDisabledName);
- options = g_list_append(options, purple_keyring_to_use);
- }
-
- for (it = purple_keyring_keyrings; it != NULL; it = it->next) {
- PurpleKeyring *keyring = it->data;
-
- options = g_list_append(options,
- (gpointer)purple_keyring_get_name(keyring));
- options = g_list_append(options,
- (gpointer)purple_keyring_get_id(keyring));
- }
-
- return options;
-}
-
-
-/**************************************************************************/
-/* Keyring plugin wrappers */
-/**************************************************************************/
-
-static void
-purple_keyring_close(PurpleKeyring *keyring)
-{
- PurpleKeyringClose close_cb;
-
- g_return_if_fail(keyring != NULL);
-
- if (keyring->is_cancelling) {
- keyring->close_after_cancel = TRUE;
- return;
- }
- if (keyring->is_closing)
- return;
- keyring->is_closing = TRUE;
-
- close_cb = purple_keyring_get_close_keyring(keyring);
-
- if (close_cb != NULL)
- close_cb();
-
- keyring->is_closing = FALSE;
-}
-
-static void
-purple_keyring_cancel_requests(PurpleKeyring *keyring)
-{
- PurpleKeyringCancelRequests cancel_cb;
-
- g_return_if_fail(keyring != NULL);
-
- if (keyring->is_cancelling)
- return;
- keyring->is_cancelling = TRUE;
-
- cancel_cb = purple_keyring_get_cancel_requests(keyring);
-
- if (cancel_cb != NULL)
- cancel_cb();
-
- keyring->is_cancelling = FALSE;
-
- if (keyring->close_after_cancel) {
- keyring->close_after_cancel = FALSE;
- purple_keyring_close(keyring);
- }
-}
-
-static void
-purple_keyring_drop_passwords_save_cb(PurpleAccount *account, GError *error,
- gpointer _tracker)
-{
- PurpleKeyringDropTracker *tracker = _tracker;
-
- tracker->drop_outstanding--;
-
- if (!tracker->finished || tracker->drop_outstanding > 0)
- return;
-
- if (tracker->cb)
- tracker->cb(tracker->cb_data);
- g_free(tracker);
-}
-
-static void
-purple_keyring_drop_passwords(PurpleKeyring *keyring,
- PurpleKeyringDropCallback cb, gpointer data)
-{
- GList *it;
- PurpleKeyringSave save_cb;
- PurpleKeyringDropTracker *tracker;
-
- g_return_if_fail(keyring != NULL);
-
- save_cb = purple_keyring_get_save_password(keyring);
- g_assert(save_cb != NULL);
-
- it = purple_accounts_get_all();
- if (it == NULL)
- return;
-
- tracker = g_new0(PurpleKeyringDropTracker, 1);
- tracker->cb = cb;
- tracker->cb_data = data;
-
- for (; it != NULL; it = it->next) {
- PurpleAccount *account = it->data;
-
- tracker->drop_outstanding++;
- if (it->next == NULL)
- tracker->finished = TRUE;
-
- save_cb(account, NULL, purple_keyring_drop_passwords_save_cb,
- tracker);
- }
-}
-
-gboolean
-purple_keyring_import_password(PurpleAccount *account, const gchar *keyring_id,
- const gchar *mode, const gchar *data, GError **error)
-{
- PurpleKeyring *keyring;
- PurpleKeyring *inuse;
- PurpleKeyringImportPassword import;
-
- g_return_val_if_fail(account != NULL, FALSE);
-
- if (keyring_id == NULL)
- keyring_id = PURPLE_DEFAULT_KEYRING;
-
- purple_debug_misc("keyring", "Importing password for account %s to "
- "keyring %s.\n", purple_keyring_print_account(account),
- keyring_id);
-
- keyring = purple_keyring_find_keyring_by_id(keyring_id);
- if (keyring == NULL) {
- g_set_error_literal(error, PURPLE_KEYRING_ERROR,
- PURPLE_KEYRING_ERROR_BACKENDFAIL,
- _("Specified keyring is not registered."));
- purple_debug_warning("Keyring", "Specified keyring is not "
- "registered, cannot import password info for account "
- "%s.\n", purple_keyring_print_account(account));
- return FALSE;
- }
-
- inuse = purple_keyring_get_inuse();
- if (inuse == NULL) {
- PurpleKeyringFailedImport *import;
- g_set_error_literal(
- error, PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOKEYRING,
- _("No keyring loaded, cannot import password info."));
- purple_debug_warning("Keyring",
- "No keyring loaded, cannot import password info for "
- "account %s.\n", purple_keyring_print_account(account));
-
- import = g_new0(PurpleKeyringFailedImport, 1);
- import->keyring_id = g_strdup(keyring_id);
- import->mode = g_strdup(mode);
- import->data = g_strdup(data);
- g_hash_table_insert(purple_keyring_failed_imports, account,
- import);
- return FALSE;
- }
-
- if (inuse != keyring) {
- g_set_error_literal(
- error, PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_INTERNAL,
- _("Specified keyring ID does not match the loaded one."));
- purple_debug_error("keyring",
- "Specified keyring %s is not currently used (%s). "
- "Data will be lost.\n", keyring_id,
- purple_keyring_get_id(inuse));
- return FALSE;
- }
-
- import = purple_keyring_get_import_password(inuse);
- if (import == NULL) {
- if (purple_debug_is_verbose()) {
- purple_debug_misc("Keyring", "Configured keyring "
- "cannot import password info. This might be "
- "normal.\n");
- }
- return TRUE;
- }
-
- return import(account, mode, data, error);
-}
-
-gboolean
-purple_keyring_export_password(PurpleAccount *account, const gchar **keyring_id,
- const gchar **mode, gchar **data, GError **error,
- GDestroyNotify *destroy)
-{
- PurpleKeyring *inuse;
- PurpleKeyringExportPassword export;
-
- g_return_val_if_fail(account != NULL, FALSE);
- g_return_val_if_fail(keyring_id != NULL, FALSE);
- g_return_val_if_fail(mode != NULL, FALSE);
- g_return_val_if_fail(data != NULL, FALSE);
- g_return_val_if_fail(error != NULL, FALSE);
-
- inuse = purple_keyring_get_inuse();
-
- if (inuse == NULL) {
- PurpleKeyringFailedImport *import = g_hash_table_lookup(
- purple_keyring_failed_imports, account);
-
- if (import == NULL) {
- g_set_error_literal(
- error, PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOKEYRING,
- _("No keyring configured, cannot export password info."));
- purple_debug_warning("keyring",
- "No keyring configured, cannot export password "
- "info.\n");
- return FALSE;
- } else {
- purple_debug_info("keyring", "No keyring configured, "
- "getting fallback export data for %s.\n",
- purple_keyring_print_account(account));
-
- *keyring_id = import->keyring_id;
- *mode = import->mode;
- *data = g_strdup(import->data);
- *destroy = (GDestroyNotify)purple_str_wipe;
- return TRUE;
- }
- }
-
- if (purple_debug_is_verbose()) {
- purple_debug_misc("keyring",
- "Exporting password for account %s from keyring %s\n",
- purple_keyring_print_account(account),
- purple_keyring_get_id(inuse));
- }
-
- *keyring_id = purple_keyring_get_id(inuse);
-
- export = purple_keyring_get_export_password(inuse);
- if (export == NULL) {
- if (purple_debug_is_verbose()) {
- purple_debug_misc("Keyring", "Configured keyring "
- "cannot export password info. This might be "
- "normal.\n");
- }
- *mode = NULL;
- *data = NULL;
- *destroy = NULL;
- return TRUE;
- }
-
- return export(account, mode, data, error, destroy);
-}
-
-/**************************************************************************/
-/* PurpleKeyring accessors */
-/**************************************************************************/
-
-PurpleKeyring *
-purple_keyring_new(void)
-{
- return g_new0(PurpleKeyring, 1);
-}
-
-void
-purple_keyring_free(PurpleKeyring *keyring)
-{
- g_return_if_fail(keyring != NULL);
-
- g_free(keyring->name);
- g_free(keyring->id);
- g_free(keyring);
-}
-
-const gchar *
-purple_keyring_get_name(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->name;
-}
-
-const gchar *
-purple_keyring_get_id(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->id;
-}
-
-PurpleKeyringRead
-purple_keyring_get_read_password(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->read_password;
-}
-
-PurpleKeyringSave
-purple_keyring_get_save_password(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->save_password;
-}
-
-PurpleKeyringCancelRequests
-purple_keyring_get_cancel_requests(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->cancel_requests;
-}
-
-PurpleKeyringClose
-purple_keyring_get_close_keyring(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->close_keyring;
-}
-
-PurpleKeyringImportPassword
-purple_keyring_get_import_password(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->import_password;
-}
-
-PurpleKeyringExportPassword
-purple_keyring_get_export_password(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->export_password;
-}
-
-PurpleKeyringReadSettings
-purple_keyring_get_read_settings(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->read_settings;
-}
-
-PurpleKeyringApplySettings
-purple_keyring_get_apply_settings(const PurpleKeyring *keyring)
-{
- g_return_val_if_fail(keyring != NULL, NULL);
-
- return keyring->apply_settings;
-}
-
-void
-purple_keyring_set_name(PurpleKeyring *keyring, const gchar *name)
-{
- g_return_if_fail(keyring != NULL);
- g_return_if_fail(name != NULL);
-
- g_free(keyring->name);
- keyring->name = g_strdup(name);
-}
-
-void
-purple_keyring_set_id(PurpleKeyring *keyring, const gchar *id)
-{
- g_return_if_fail(keyring != NULL);
- g_return_if_fail(id != NULL);
-
- g_free(keyring->id);
- keyring->id = g_strdup(id);
-}
-
-void
-purple_keyring_set_read_password(PurpleKeyring *keyring,
- PurpleKeyringRead read_cb)
-{
- g_return_if_fail(keyring != NULL);
- g_return_if_fail(read_cb != NULL);
-
- keyring->read_password = read_cb;
-}
-
-void
-purple_keyring_set_save_password(PurpleKeyring *keyring,
- PurpleKeyringSave save_cb)
-{
- g_return_if_fail(keyring != NULL);
- g_return_if_fail(save_cb != NULL);
-
- keyring->save_password = save_cb;
-}
-
-void
-purple_keyring_set_cancel_requests(PurpleKeyring *keyring,
- PurpleKeyringCancelRequests cancel_requests)
-{
- g_return_if_fail(keyring != NULL);
-
- keyring->cancel_requests = cancel_requests;
-}
-
-void
-purple_keyring_set_close_keyring(PurpleKeyring *keyring,
- PurpleKeyringClose close_cb)
-{
- g_return_if_fail(keyring != NULL);
-
- keyring->close_keyring = close_cb;
-}
-
-void
-purple_keyring_set_import_password(PurpleKeyring *keyring,
- PurpleKeyringImportPassword import_password)
-{
- g_return_if_fail(keyring != NULL);
-
- keyring->import_password = import_password;
-}
-
-void
-purple_keyring_set_export_password(PurpleKeyring *keyring,
- PurpleKeyringExportPassword export_password)
-{
- g_return_if_fail(keyring != NULL);
-
- keyring->export_password = export_password;
-}
-
-void
-purple_keyring_set_read_settings(PurpleKeyring *keyring,
-PurpleKeyringReadSettings read_settings)
-{
- g_return_if_fail(keyring != NULL);
-
- keyring->read_settings = read_settings;
-}
-
-void
-purple_keyring_set_apply_settings(PurpleKeyring *keyring,
-PurpleKeyringApplySettings apply_settings)
-{
- g_return_if_fail(keyring != NULL);
-
- keyring->apply_settings = apply_settings;
-}
-
-
-/**************************************************************************/
-/* Error Codes */
-/**************************************************************************/
-
-GQuark purple_keyring_error_domain(void)
-{
- return g_quark_from_static_string("libpurple keyring");
-}
-
-/**************************************************************************/
-/* Keyring Subsystem */
-/**************************************************************************/
-
-static void purple_keyring_core_initialized_cb(void)
-{
- if (purple_keyring_inuse == NULL) {
- purple_notify_error(NULL, _("Keyrings"),
- _("Failed to load selected keyring."),
- _("Check your system configuration or select another "
- "one in Preferences dialog."), NULL);
- }
-}
-
-static void purple_keyring_core_quitting_cb()
-{
- if (current_change_tracker != NULL) {
- PurpleKeyringChangeTracker *tracker = current_change_tracker;
- tracker->abort = TRUE;
- if (tracker->old_kr)
- purple_keyring_cancel_requests(tracker->old_kr);
- if (current_change_tracker == tracker && tracker->new_kr)
- purple_keyring_cancel_requests(tracker->new_kr);
- }
-
- purple_keyring_is_quitting = TRUE;
- if (purple_keyring_inuse != NULL)
- purple_keyring_cancel_requests(purple_keyring_inuse);
-}
-
-void
-purple_keyring_init(void)
-{
- const gchar *touse;
- GList *plugins, *it;
-
- purple_keyring_keyrings = NULL;
- purple_keyring_inuse = NULL;
-
- purple_keyring_failed_imports = g_hash_table_new_full(g_direct_hash,
- g_direct_equal, NULL,
- (GDestroyNotify)purple_keyring_failed_import_free);
-
- /* void keyring_register(const char *keyring_id,
- * PurpleKeyring * keyring);
- *
- * A signal called when keyring is registered.
- *
- * @param keyring_id The keyring ID.
- * @param keyring The keyring.
- */
- purple_signal_register(purple_keyring_get_handle(), "keyring-register",
- purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2, G_TYPE_STRING,
- PURPLE_TYPE_KEYRING);
-
- /* void keyring_unregister(const char *keyring_id,
- * PurpleKeyring * keyring);
- *
- * A signal called when keyring is unregistered.
- *
- * @param keyring_id The keyring ID.
- * @param keyring The keyring.
- */
- purple_signal_register(purple_keyring_get_handle(), "keyring-unregister",
- purple_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2, G_TYPE_STRING,
- PURPLE_TYPE_KEYRING);
-
- /* void password_migration(PurpleAccount* account);
- *
- * A signal called, when a password for the account was moved to another
- * keyring.
- *
- * @param account The account.
- */
- purple_signal_register(purple_keyring_get_handle(), "password-migration",
- purple_marshal_VOID__POINTER, G_TYPE_NONE, 1, PURPLE_TYPE_ACCOUNT);
-
- touse = purple_prefs_get_string("/purple/keyring/active");
- if (touse == NULL) {
- purple_prefs_add_none("/purple/keyring");
- purple_prefs_add_string("/purple/keyring/active",
- PURPLE_DEFAULT_KEYRING);
- purple_keyring_to_use = g_strdup(PURPLE_DEFAULT_KEYRING);
- } else
- purple_keyring_to_use = g_strdup(touse);
-
- purple_keyring_pref_connect();
-
- plugins = purple_plugins_find_all();
- for (it = plugins; it != NULL; it = it->next) {
- PurplePlugin *plugin = PURPLE_PLUGIN(it->data);
- GPluginPluginInfo *info =
- GPLUGIN_PLUGIN_INFO(purple_plugin_get_info(plugin));
-
- if (!g_str_has_prefix(gplugin_plugin_info_get_id(info), "keyring-")) {
- continue;
- }
-
- if (purple_plugin_is_loaded(plugin))
- continue;
-
- if (purple_plugin_load(plugin, NULL)) {
- purple_keyring_loaded_plugins = g_list_append(
- purple_keyring_loaded_plugins, plugin);
- }
- }
- g_list_free(plugins);
-
- if (purple_keyring_inuse == NULL)
- purple_debug_error("keyring", "Selected keyring failed to load\n");
-
- purple_signal_connect(purple_get_core(), "core-initialized",
- purple_keyring_get_handle(),
- PURPLE_CALLBACK(purple_keyring_core_initialized_cb), NULL);
- purple_signal_connect(purple_get_core(), "quitting",
- purple_keyring_get_handle(),
- PURPLE_CALLBACK(purple_keyring_core_quitting_cb), NULL);
-}
-
-void
-purple_keyring_uninit(void)
-{
- GList *it;
-
- purple_keyring_pref_disconnect();
-
- g_free(purple_keyring_to_use);
- purple_keyring_inuse = NULL;
-
- g_hash_table_destroy(purple_keyring_failed_imports);
- purple_keyring_failed_imports = NULL;
-
- for (it = g_list_first(purple_keyring_loaded_plugins); it != NULL;
- it = g_list_next(it))
- {
- PurplePlugin *plugin = PURPLE_PLUGIN(it->data);
- if (g_list_find(purple_plugins_get_loaded(), plugin) == NULL)
- continue;
- purple_plugin_unload(plugin, NULL);
- }
- g_list_free(purple_keyring_loaded_plugins);
- purple_keyring_loaded_plugins = NULL;
-
- purple_signals_unregister_by_instance(purple_keyring_get_handle());
- purple_signals_disconnect_by_handle(purple_keyring_get_handle());
-}
-
-void *
-purple_keyring_get_handle(void)
-{
- static int handle;
-
- return &handle;
-}
-
-static PurpleKeyring *
-purple_keyring_copy(PurpleKeyring *keyring)
-{
- PurpleKeyring *keyring_copy;
-
- g_return_val_if_fail(keyring != NULL, NULL);
-
- keyring_copy = purple_keyring_new();
- *keyring_copy = *keyring;
-
- keyring_copy->name = g_strdup(keyring->name);
- keyring_copy->id = g_strdup(keyring->id);
-
- return keyring_copy;
-}
-
-GType
-purple_keyring_get_type(void)
-{
- static GType type = 0;
-
- if (type == 0) {
- type = g_boxed_type_register_static("PurpleKeyring",
- (GBoxedCopyFunc)purple_keyring_copy,
- (GBoxedFreeFunc)purple_keyring_free);
- }
-
- return type;
-}
--- a/libpurple/keyring.h Mon Apr 19 20:55:45 2021 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,604 +0,0 @@
-/* purple
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- */
-
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#endif
-
-#ifndef PURPLE_KEYRING_H
-#define PURPLE_KEYRING_H
-/**
- * SECTION:keyring
- * @section_id: libpurple-keyring
- * @short_description: <filename>keyring.h</filename>
- * @title: Keyring API
- */
-
-#include "account.h"
-#include "request.h"
-
-#define PURPLE_TYPE_KEYRING (purple_keyring_get_type())
-
-/**
- * PURPLE_DEFAULT_KEYRING:
- *
- * Default keyring ID.
- */
-#define PURPLE_DEFAULT_KEYRING "keyring-internal"
-
-/**
- * PURPLE_KEYRING_ERROR:
- *
- * Keyring subsystem error domain.
- */
-#define PURPLE_KEYRING_ERROR purple_keyring_error_domain()
-
-/**************************************************************************/
-/* Data structures and types */
-/**************************************************************************/
-
-typedef struct _PurpleKeyring PurpleKeyring;
-
-/**************************************************************************/
-/* Callbacks for keyrings access functions */
-/**************************************************************************/
-
-/**
- * PurpleKeyringReadCallback:
- * @account: The account.
- * @password: The password.
- * @error: Error that may have occurred.
- * @data: Data passed to the callback.
- *
- * Callback for once a password is read.
- *
- * If there was a problem, the password will be NULL, and the error set.
- */
-typedef void (*PurpleKeyringReadCallback)(PurpleAccount *account,
- const gchar *password, GError *error, gpointer data);
-
-/**
- * PurpleKeyringSaveCallback:
- * @account: The account.
- * @error: Error that may have occurred.
- * @data: Data passed to the callback.
- *
- * Callback for once a password has been stored.
- *
- * If there was a problem, the error will be set.
- */
-typedef void (*PurpleKeyringSaveCallback)(PurpleAccount *account, GError *error,
- gpointer data);
-
-/**
- * PurpleKeyringChangeMasterCallback:
- * @error: Error that has occurred.
- * @data: Data passed to the callback.
- *
- * Callback for once the master password for a keyring has been changed.
- */
-typedef void (*PurpleKeyringChangeMasterCallback)(GError *error, gpointer data);
-
-/**
- * PurpleKeyringSetInUseCallback:
- * @error: An error that might have occurred.
- * @data: A pointer to user supplied data.
- *
- * Callback for when we change the keyring.
- */
-typedef void (*PurpleKeyringSetInUseCallback)(GError *error, gpointer data);
-
-/**************************************************************************/
-/* Keyrings access functions */
-/**************************************************************************/
-
-/**
- * PurpleKeyringRead:
- * @account: The account.
- * @cb: A callback for once the password is found.
- * @data: Data to be passed to the callback.
- *
- * Read the password for an account.
- */
-typedef void (*PurpleKeyringRead)(PurpleAccount *account,
- PurpleKeyringReadCallback cb, gpointer data);
-
-/**
- * PurpleKeyringSave:
- * @account: The account.
- * @password: The password to be stored. If the password is NULL, this
- * means that the keyring should forget about that password.
- * @cb: A callback for once the password is saved.
- * @data: Data to be passed to the callback.
- *
- * Store a password in the keyring.
- */
-typedef void (*PurpleKeyringSave)(PurpleAccount *account, const gchar *password,
- PurpleKeyringSaveCallback cb, gpointer data);
-
-/**
- * PurpleKeyringCancelRequests:
- *
- * Cancel all running requests.
- *
- * After calling that, all queued requests should run their callbacks (most
- * probably, with failure result).
- */
-typedef void (*PurpleKeyringCancelRequests)(void);
-
-/**
- * PurpleKeyringClose:
- *
- * Close the keyring.
- *
- * This will be called so the keyring can do any cleanup it needs.
- */
-typedef void (*PurpleKeyringClose)(void);
-
-/**
- * PurpleKeyringImportPassword:
- * @account: The account.
- * @mode: A keyring specific option that was stored. Can be NULL.
- * @data: Data that was stored. Can be NULL.
- * @error: Error that may have occurred.
- *
- * Import serialized (and maybe encrypted) password.
- *
- * This is not async because it is not meant to prompt for a master password and
- * decrypt passwords.
- *
- * Returns: TRUE on success, FALSE on failure.
- */
-typedef gboolean (*PurpleKeyringImportPassword)(PurpleAccount *account,
- const gchar *mode, const gchar *data, GError **error);
-
-/**
- * PurpleKeyringExportPassword:
- * @account: The account.
- * @mode: An option field that can be used by the plugin. This is
- * expected to be a static string.
- * @data: The data to be stored in the XML node. This string will be
- * freed using destroy() once not needed anymore.
- * @error: Will be set if a problem occured.
- * @destroy: A function to be called, if non NULL, to free data.
- *
- * Export serialized (and maybe encrypted) password.
- *
- * Returns: TRUE on success, FALSE on failure.
- */
-typedef gboolean (*PurpleKeyringExportPassword)(PurpleAccount *account,
- const gchar **mode, gchar **data, GError **error,
- GDestroyNotify *destroy);
-
-/**
- * PurpleKeyringReadSettings:
- *
- * Read keyring settings.
- *
- * Returns: New copy of current settings (must be free'd with
- * purple_request_fields_destroy).
- */
-typedef PurpleRequestFields * (*PurpleKeyringReadSettings)(void);
-
-/**
- * PurpleKeyringApplySettings:
- * @notify_handle: A handle that can be passed to purple_notify_message.
- * @fields: Modified settings (originally taken from
- * PurpleKeyringReadSettings).
- *
- * Applies modified keyring settings.
- *
- * Returns: TRUE, if succeeded, FALSE otherwise.
- */
-typedef gboolean (*PurpleKeyringApplySettings)(void *notify_handle,
- PurpleRequestFields *fields);
-
-G_BEGIN_DECLS
-
-/**************************************************************************/
-/* Setting used keyrings */
-/**************************************************************************/
-
-/**
- * purple_keyring_find_keyring_by_id:
- * @id: The id for the keyring.
- *
- * Find a keyring by an id.
- *
- * Returns: The keyring, or NULL if not found.
- */
-PurpleKeyring *
-purple_keyring_find_keyring_by_id(const gchar *id);
-
-/**
- * purple_keyring_get_inuse:
- *
- * Get the keyring being used.
- */
-PurpleKeyring *
-purple_keyring_get_inuse(void);
-
-/**
- * purple_keyring_set_inuse:
- * @newkeyring: The new keyring to use.
- * @force: %FALSE if the change can be cancelled. If this is %TRUE
- * and an error occurs, data might be lost.
- * @cb: (scope call): A callback for once the change is complete.
- * @data: Data to be passed to the callback.
- *
- * Set the keyring to use. This function will move all passwords from
- * the old keyring to the new one.
- *
- * If it fails, it will cancel all changes, close the new keyring, and notify
- * the callback. If it succeeds, it will remove all passwords from the old safe
- * and close that safe.
- */
-void
-purple_keyring_set_inuse(PurpleKeyring *newkeyring, gboolean force,
- PurpleKeyringSetInUseCallback cb, gpointer data);
-
-/**
- * purple_keyring_register:
- * @keyring: The keyring to register.
- *
- * Register a keyring plugin.
- */
-void
-purple_keyring_register(PurpleKeyring *keyring);
-
-/**
- * purple_keyring_unregister:
- * @keyring: The keyring to unregister.
- *
- * Unregister a keyring plugin.
- *
- * In case the keyring is in use, passwords will be moved to a fallback safe,
- * and the keyring to unregister will be properly closed.
- */
-void
-purple_keyring_unregister(PurpleKeyring *keyring);
-
-/**
- * purple_keyring_get_options:
- *
- * Returns a GList containing the IDs and names of the registered
- * keyrings.
- *
- * Returns: (element-type utf8) (transfer container): The list of IDs and names.
- */
-GList *
-purple_keyring_get_options(void);
-
-/**************************************************************************/
-/* Keyring plugin wrappers */
-/**************************************************************************/
-
-/**
- * purple_keyring_import_password:
- * @account: The account.
- * @keyring_id: The plugin ID that was stored in the xml file. Can be NULL.
- * @mode: A keyring specific option that was stored. Can be NULL.
- * @data: Data that was stored, can be NULL.
- * @error: Error that may have occurred.
- *
- * Import serialized (and maybe encrypted) password into current keyring.
- *
- * It's used by account.c while reading a password from xml.
- *
- * Returns: TRUE if the input was accepted, FALSE otherwise.
- */
-gboolean
-purple_keyring_import_password(PurpleAccount *account, const gchar *keyring_id,
- const gchar *mode, const gchar *data, GError **error);
-
-/**
- * purple_keyring_export_password:
- * @account: The account for which we want the info.
- * @keyring_id: The plugin id to be stored in the XML node. This will be
- * NULL or a string that can be considered static.
- * @mode: An option field that can be used by the plugin. This will
- * be NULL or a string that can be considered static.
- * @data: The data to be stored in the XML node. This string must be
- * freed using destroy() once not needed anymore if it is not
- * NULL.
- * @error: Will be set if a problem occured.
- * @destroy: A function to be called, if non NULL, to free data.
- *
- * Export serialized (and maybe encrypted) password out of current keyring.
- *
- * It's used by account.c while syncing accounts to xml.
- *
- * Returns: TRUE if the info was exported successfully, FALSE otherwise.
- */
-gboolean
-purple_keyring_export_password(PurpleAccount *account, const gchar **keyring_id,
- const gchar **mode, gchar **data, GError **error,
- GDestroyNotify *destroy);
-
-/**************************************************************************/
-/* PurpleKeyring accessors */
-/**************************************************************************/
-
-/**
- * purple_keyring_get_type:
- *
- * Returns: The #GType for the #PurpleKeyring boxed structure.
- */
-GType purple_keyring_get_type(void);
-
-/**
- * purple_keyring_new:
- *
- * Creates a new keyring wrapper.
- */
-PurpleKeyring *
-purple_keyring_new(void);
-
-/**
- * purple_keyring_free:
- * @keyring: Keyring wrapper struct.
- *
- * Frees all data allocated with purple_keyring_new.
- */
-void
-purple_keyring_free(PurpleKeyring *keyring);
-
-/**
- * purple_keyring_get_name:
- * @keyring: The keyring.
- *
- * Gets friendly user name.
- *
- * Returns: Friendly user name.
- */
-const gchar *
-purple_keyring_get_name(const PurpleKeyring *keyring);
-
-/**
- * purple_keyring_get_id:
- * @keyring: The keyring.
- *
- * Gets keyring ID.
- *
- * Returns: Keyring ID.
- */
-const gchar *
-purple_keyring_get_id(const PurpleKeyring *keyring);
-
-PurpleKeyringRead
-purple_keyring_get_read_password(const PurpleKeyring *keyring);
-
-PurpleKeyringSave
-purple_keyring_get_save_password(const PurpleKeyring *keyring);
-
-PurpleKeyringCancelRequests
-purple_keyring_get_cancel_requests(const PurpleKeyring *keyring);
-
-PurpleKeyringClose
-purple_keyring_get_close_keyring(const PurpleKeyring *keyring);
-
-PurpleKeyringImportPassword
-purple_keyring_get_import_password(const PurpleKeyring *keyring);
-
-PurpleKeyringExportPassword
-purple_keyring_get_export_password(const PurpleKeyring *keyring);
-
-PurpleKeyringReadSettings
-purple_keyring_get_read_settings(const PurpleKeyring *keyring);
-
-PurpleKeyringApplySettings
-purple_keyring_get_apply_settings(const PurpleKeyring *keyring);
-
-/**
- * purple_keyring_set_name:
- * @keyring: The keyring.
- * @name: Friendly user name.
- *
- * Sets friendly user name.
- *
- * This field is required.
- */
-void
-purple_keyring_set_name(PurpleKeyring *keyring, const gchar *name);
-
-/**
- * purple_keyring_set_id:
- * @keyring: The keyring.
- * @id: Keyring ID.
- *
- * Sets keyring ID.
- *
- * This field is required.
- */
-void
-purple_keyring_set_id(PurpleKeyring *keyring, const gchar *id);
-
-/**
- * purple_keyring_set_read_password:
- * @keyring: The keyring.
- * @read_cb: (scope call): Read password method.
- *
- * Sets read password method.
- *
- * This field is required.
- */
-void
-purple_keyring_set_read_password(PurpleKeyring *keyring,
- PurpleKeyringRead read_cb);
-
-/**
- * purple_keyring_set_save_password:
- * @keyring: The keyring.
- * @save_cb: (scope call): Save password method.
- *
- * Sets save password method.
- *
- * This field is required.
- */
-void
-purple_keyring_set_save_password(PurpleKeyring *keyring,
- PurpleKeyringSave save_cb);
-
-/**
- * purple_keyring_set_cancel_requests:
- * @keyring: The keyring.
- * @cancel_requests: (scope call): Cancel requests method.
- *
- * Sets cancel requests method.
- */
-void
-purple_keyring_set_cancel_requests(PurpleKeyring *keyring,
- PurpleKeyringCancelRequests cancel_requests);
-
-/**
- * purple_keyring_set_close_keyring:
- * @keyring: The keyring.
- * @close_cb: (scope call): Close keyring method.
- *
- * Sets close keyring method.
- */
-void
-purple_keyring_set_close_keyring(PurpleKeyring *keyring,
- PurpleKeyringClose close_cb);
-
-/**
- * purple_keyring_set_import_password:
- * @keyring: The keyring.
- * @import_password: (scope call): Import password method.
- *
- * Sets import password method.
- */
-void
-purple_keyring_set_import_password(PurpleKeyring *keyring,
- PurpleKeyringImportPassword import_password);
-
-/**
- * purple_keyring_set_export_password:
- * @keyring: The keyring.
- * @export_password: (scope call): Export password method.
- *
- * Sets export password method.
- */
-void
-purple_keyring_set_export_password(PurpleKeyring *keyring,
- PurpleKeyringExportPassword export_password);
-
-/**
- * purple_keyring_set_read_settings:
- * @keyring: The keyring.
- * @read_settings: (scope call): Read settings method.
- *
- * Sets read settings method.
- */
-void
-purple_keyring_set_read_settings(PurpleKeyring *keyring,
- PurpleKeyringReadSettings read_settings);
-
-/**
- * purple_keyring_set_apply_settings:
- * @keyring: The keyring.
- * @apply_settings: (scope call): Apply settings method.
- *
- * Sets apply settings method.
- */
-void
-purple_keyring_set_apply_settings(PurpleKeyring *keyring,
- PurpleKeyringApplySettings apply_settings);
-
-/**************************************************************************/
-/* Error Codes */
-/**************************************************************************/
-
-/**
- * purple_keyring_error_domain:
- *
- * Gets keyring subsystem error domain.
- *
- * Returns: keyring subsystem error domain.
- */
-GQuark
-purple_keyring_error_domain(void);
-
-/**
- * PurpleKeyringError:
- * @PURPLE_KEYRING_ERROR_UNKNOWN: Unknown error.
- * @PURPLE_KEYRING_ERROR_NOKEYRING: No keyring configured.
- * @PURPLE_KEYRING_ERROR_INTERNAL: Internal keyring system error.
- * @PURPLE_KEYRING_ERROR_BACKENDFAIL: Failed to communicate with the backend
- * or internal backend error.
- * @PURPLE_KEYRING_ERROR_NOPASSWORD: No password stored for the specified
- * account.
- * @PURPLE_KEYRING_ERROR_ACCESSDENIED: Access denied for the specified keyring
- * or entry.
- * @PURPLE_KEYRING_ERROR_CANCELLED: Operation was cancelled.
- *
- * Error codes for keyring subsystem.
- */
-enum PurpleKeyringError
-{
- PURPLE_KEYRING_ERROR_UNKNOWN = 0,
-
- PURPLE_KEYRING_ERROR_NOKEYRING = 10,
- PURPLE_KEYRING_ERROR_INTERNAL,
- PURPLE_KEYRING_ERROR_BACKENDFAIL,
-
- PURPLE_KEYRING_ERROR_NOPASSWORD = 20,
- PURPLE_KEYRING_ERROR_ACCESSDENIED,
- PURPLE_KEYRING_ERROR_CANCELLED
-};
-
-/*}@*/
-
-/**************************************************************************/
-/* Keyring Subsystem */
-/**************************************************************************/
-
-/**
- * purple_keyring_init:
- *
- * Initializes the keyring subsystem.
- */
-void
-purple_keyring_init(void);
-
-/**
- * purple_keyring_uninit:
- *
- * Uninitializes the keyring subsystem.
- */
-void
-purple_keyring_uninit(void);
-
-/**
- * purple_keyring_get_handle:
- *
- * Returns the keyring subsystem handle.
- *
- * Returns: The keyring subsystem handle.
- */
-void *
-purple_keyring_get_handle(void);
-
-/*}@*/
-
-G_END_DECLS
-
-#endif /* PURPLE_KEYRING_H */
--- a/libpurple/meson.build Mon Apr 19 20:55:45 2021 -0500
+++ b/libpurple/meson.build Wed Apr 21 18:43:42 2021 -0500
@@ -21,7 +21,6 @@
'idle.c',
'image.c',
'image-store.c',
- 'keyring.c',
'log.c',
'media/backend-fs2.c',
'media/backend-iface.c',
@@ -119,7 +118,6 @@
'idle.h',
'image.h',
'image-store.h',
- 'keyring.h',
'log.h',
'media.h',
'mediamanager.h',
--- a/libpurple/plugins/keyrings/meson.build Mon Apr 19 20:55:45 2021 -0500
+++ b/libpurple/plugins/keyrings/meson.build Wed Apr 21 18:43:42 2021 -0500
@@ -5,7 +5,8 @@
internalkeyring_plugin = library('internalkeyring', 'internalkeyring.c',
dependencies : [nettle, libpurple_dep],
name_prefix : '',
- install : true, install_dir : PURPLE_PLUGINDIR)
+ build_by_default : false,
+ install : false, install_dir : PURPLE_PLUGINDIR)
endif
if secretservice.found()
--- a/pidgin/gtkprefs.c Mon Apr 19 20:55:45 2021 -0500
+++ b/pidgin/gtkprefs.c Wed Apr 21 18:43:42 2021 -0500
@@ -178,15 +178,6 @@
GtkWidget *password;
} proxy;
- /* Keyrings page */
- struct {
- PidginPrefCombo active;
- GtkWidget *vbox;
- PurpleRequestFields *settings;
- GtkWidget *settings_box;
- GtkWidget *apply;
- } keyring;
-
/* Away page */
struct {
PidginPrefCombo idle_reporting;
@@ -410,17 +401,6 @@
cb(combo_box, active);
}
-static void
-pidgin_prefs_bind_dropdown_revert_active(PidginPrefCombo *combo)
-{
- g_return_if_fail(combo != NULL);
-
- combo->current_active = combo->previously_active;
-
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo->combo),
- combo->previously_active);
-}
-
static GtkWidget *
pidgin_prefs_dropdown_from_list_with_cb(GtkWidget *box, const gchar *title,
GtkComboBox **dropdown_out, GList *menuitems,
@@ -826,8 +806,6 @@
G_CALLBACK(set_bool_pref), (char *)key);
}
-static void keyring_page_cleanup(PidginPrefsWindow *win);
-
static void
delete_prefs(GtkWidget *asdf, void *gdsa)
{
@@ -845,8 +823,6 @@
prefs_status_themes_combo_box = NULL;
prefs_smiley_themes_combo_box = NULL;
- keyring_page_cleanup(prefs);
-
g_free(prefs->proxy.gnome_program_path);
prefs = NULL;
}
@@ -1888,232 +1864,6 @@
win->logging.log_system);
}
-/*** keyring page *******************************************************/
-
-static void
-keyring_page_settings_changed(GtkWidget *widget, gpointer _setting)
-{
- PurpleRequestField *setting = _setting;
- PurpleRequestFieldType field_type;
-
- gtk_widget_set_sensitive(prefs->keyring.apply, TRUE);
-
- field_type = purple_request_field_get_field_type(setting);
-
- if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
- purple_request_field_bool_set_value(setting,
- gtk_toggle_button_get_active(
- GTK_TOGGLE_BUTTON(widget)));
- } else if (field_type == PURPLE_REQUEST_FIELD_STRING) {
- purple_request_field_string_set_value(setting,
- gtk_entry_get_text(GTK_ENTRY(widget)));
- } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
- purple_request_field_int_set_value(setting,
- gtk_spin_button_get_value_as_int(
- GTK_SPIN_BUTTON(widget)));
- } else
- g_return_if_reached();
-}
-
-static void
-keyring_page_add_settings_field(GtkBox *vbox, PurpleRequestField *setting,
- GtkSizeGroup *sg)
-{
- GtkWidget *widget;
- PurpleRequestFieldType field_type;
- const gchar *label;
-
- label = purple_request_field_get_label(setting);
-
- field_type = purple_request_field_get_field_type(setting);
- if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
- widget = gtk_check_button_new_with_label(label);
- label = NULL;
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
- purple_request_field_bool_get_value(setting));
- g_signal_connect(G_OBJECT(widget), "toggled",
- G_CALLBACK(keyring_page_settings_changed), setting);
- } else if (field_type == PURPLE_REQUEST_FIELD_STRING) {
- widget = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(widget),
- purple_request_field_string_get_value(setting));
- if (purple_request_field_string_is_masked(setting))
- gtk_entry_set_visibility(GTK_ENTRY(widget), FALSE);
- g_signal_connect(G_OBJECT(widget), "changed",
- G_CALLBACK(keyring_page_settings_changed), setting);
- } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
- widget = gtk_spin_button_new_with_range(
- purple_request_field_int_get_lower_bound(setting),
- purple_request_field_int_get_upper_bound(setting), 1);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),
- purple_request_field_int_get_value(setting));
- g_signal_connect(G_OBJECT(widget), "value-changed",
- G_CALLBACK(keyring_page_settings_changed), setting);
- } else {
- purple_debug_error("gtkprefs", "Unsupported field type\n");
- return;
- }
-
- pidgin_add_widget_to_vbox(vbox, label, sg, widget, FALSE, NULL);
-}
-
-/* XXX: it could be available for all plugins, not keyrings only */
-static void
-keyring_page_add_settings(PidginPrefsWindow *win)
-{
- GtkWidget *box;
- GList *it, *groups;
- GtkSizeGroup *sg;
-
- box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
- gtk_box_pack_start(GTK_BOX(win->keyring.vbox), box, FALSE, FALSE, 0);
-
- sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
- groups = purple_request_fields_get_groups(win->keyring.settings);
- for (it = g_list_first(groups); it != NULL; it = g_list_next(it)) {
- GList *it2, *fields;
- GtkBox *vbox;
- PurpleRequestFieldGroup *group;
- const gchar *group_title;
-
- group = it->data;
- group_title = purple_request_field_group_get_title(group);
- if (group_title) {
- vbox = GTK_BOX(pidgin_make_frame(box, group_title));
- } else {
- vbox = GTK_BOX(box);
- }
-
- fields = purple_request_field_group_get_fields(group);
- for (it2 = g_list_first(fields); it2 != NULL;
- it2 = g_list_next(it2)) {
- keyring_page_add_settings_field(vbox, it2->data, sg);
- }
- }
-
- g_object_unref(sg);
-
- win->keyring.settings_box = box;
-}
-
-static void
-keyring_page_settings_apply(GtkButton *button, gpointer data)
-{
- PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
- PurpleRequestFields *fields= win->keyring.settings;
- PurpleCredentialManager *manager = purple_credential_manager_get_default();
-
- if(!purple_credential_manager_write_settings(manager, fields, NULL)) {
- return;
- }
-
- gtk_widget_set_sensitive(win->keyring.apply, FALSE);
-}
-
-static void
-keyring_page_update_settings(PidginPrefsWindow *win)
-{
- PurpleCredentialManager *manager = purple_credential_manager_get_default();
-
- g_clear_pointer(&win->keyring.settings, purple_request_fields_destroy);
- win->keyring.settings = purple_credential_manager_read_settings(manager,
- NULL);
- if (!win->keyring.settings) {
- return;
- }
-
- keyring_page_add_settings(win);
-
- win->keyring.apply = gtk_button_new_with_mnemonic(_("_Apply"));
- gtk_box_pack_start(GTK_BOX(win->keyring.settings_box),
- win->keyring.apply, FALSE, FALSE, 1);
- gtk_widget_set_sensitive(win->keyring.apply, FALSE);
- g_signal_connect(G_OBJECT(win->keyring.apply), "clicked",
- G_CALLBACK(keyring_page_settings_apply), win);
-
- gtk_widget_show_all(win->keyring.settings_box);
-}
-
-static void
-keyring_page_pref_set_inuse(GError *error, G_GNUC_UNUSED gpointer unused)
-{
- PurpleKeyring *in_use = purple_keyring_get_inuse();
-
- if (prefs == NULL) {
- purple_debug_info("gtkprefs", "pref window already closed\n");
- return;
- }
-
- gtk_widget_set_sensitive(GTK_WIDGET(prefs->keyring.active.combo), TRUE);
-
- if (error != NULL) {
- pidgin_prefs_bind_dropdown_revert_active(
- &prefs->keyring.active);
- purple_notify_error(NULL, _("Keyring"),
- _("Failed to set new keyring"), error->message, NULL);
- return;
- }
-
- g_return_if_fail(in_use != NULL);
- purple_prefs_set_string("/purple/keyring/active",
- purple_keyring_get_id(in_use));
-
- keyring_page_update_settings(prefs);
-}
-
-static void
-keyring_page_pref_changed(GtkComboBox *combo_box, PidginPrefCombo *combo)
-{
- const char *keyring_id;
- PurpleKeyring *keyring;
-
- g_return_if_fail(combo_box != NULL);
-
- keyring_id = combo->value.string;
- keyring = purple_keyring_find_keyring_by_id(keyring_id);
- if (keyring == NULL) {
- pidgin_prefs_bind_dropdown_revert_active(combo);
- purple_notify_error(NULL, _("Keyring"),
- _("Selected keyring is disabled"), NULL, NULL);
- return;
- }
-
- gtk_widget_set_sensitive(GTK_WIDGET(combo_box), FALSE);
-
- g_clear_pointer(&prefs->keyring.settings_box, gtk_widget_destroy);
- g_clear_pointer(&prefs->keyring.settings,
- purple_request_fields_destroy);
-
- purple_keyring_set_inuse(keyring, FALSE, keyring_page_pref_set_inuse,
- NULL);
-}
-
-static void
-keyring_page_cleanup(PidginPrefsWindow *win)
-{
- g_clear_pointer(&win->keyring.settings, purple_request_fields_destroy);
-}
-
-static void
-bind_keyring_page(PidginPrefsWindow *win)
-{
- GList *names;
-
- /* Keyring selection */
- names = purple_keyring_get_options();
- win->keyring.active.type = PURPLE_PREF_STRING;
- win->keyring.active.key = "/purple/keyring/active";
- pidgin_prefs_bind_dropdown_from_list(&win->keyring.active, names);
- /* Override the usual callback to defer changing the pref. */
- win->keyring.active.cb = keyring_page_pref_changed;
- g_list_free(names);
-
- keyring_page_update_settings(win);
-}
-
-/*** keyring page - end *************************************************/
-
static void
set_idle_away(PurpleSavedStatus *status)
{
@@ -2691,7 +2441,6 @@
bind_logging_page(win);
bind_network_page(win);
bind_proxy_page(win);
- bind_keyring_page(win);
bind_away_page(win);
bind_theme_page(win);
#ifdef USE_VV
@@ -2876,12 +2625,6 @@
gtk_widget_class_bind_template_callback(widget_class,
proxy_print_option);
- /* Keyrings page */
- gtk_widget_class_bind_template_child(
- widget_class, PidginPrefsWindow, keyring.active.combo);
- gtk_widget_class_bind_template_child(
- widget_class, PidginPrefsWindow, keyring.vbox);
-
/* Away page */
gtk_widget_class_bind_template_child(
widget_class, PidginPrefsWindow,
--- a/pidgin/resources/Prefs/prefs.ui Mon Apr 19 20:55:45 2021 -0500
+++ b/pidgin/resources/Prefs/prefs.ui Wed Apr 21 18:43:42 2021 -0500
@@ -206,14 +206,6 @@
</row>
</data>
</object>
- <object class="GtkListStore" id="keyring.active.store">
- <columns>
- <!-- column-name text -->
- <column type="gchararray"/>
- <!-- column-name value -->
- <column type="gchararray"/>
- </columns>
- </object>
<object class="GtkListStore" id="logging.format.store">
<columns>
<!-- column-name text -->
@@ -1966,101 +1958,6 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="keyring.page">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="border-width">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">18</property>
- <child>
- <object class="GtkFrame">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label-xalign">0</property>
- <property name="shadow-type">none</property>
- <child>
- <object class="GtkAlignment">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="left-padding">12</property>
- <child>
- <object class="GtkBox" id="keyring.vbox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">Keyring:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="keyring.active.combo">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="model">keyring.active.store</property>
- <child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="margin-bottom">6</property>
- <property name="label" translatable="yes">Keyring</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="name">keyring</property>
- <property name="title" translatable="yes">Password Storage</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
<object class="GtkBox" id="away.page">
<property name="visible">True</property>
<property name="can-focus">False</property>