pidgin/pidgin

dec31ba86271
Parents 5021b2db0ee5
Children 2db097f95f6a
libsecret-keyring: Handle SECRET_ERROR_IS_LOCKED

When attempting to store a password and the keyring is locked, it
will return a SECRET_ERROR_IS_LOCKED error. This patch adds code
to handle this situation.

However, libsecret does not throw this error when looking up a
password. In order to handle that we'd need to use the
"Complete API".
--- a/libpurple/plugins/keyrings/secretservice.c Wed Sep 14 12:58:41 2016 -0500
+++ b/libpurple/plugins/keyrings/secretservice.c Wed Sep 14 13:51:37 2016 -0500
@@ -104,6 +104,16 @@
"Failed to communicate with Secret "
"Service (account: %s).",
purple_account_get_username(account));
+ } else if (g_error_matches(old_error, SECRET_ERROR,
+ SECRET_ERROR_IS_LOCKED)) {
+ purple_debug_info("keyring-libsecret",
+ "Secret Service is locked (account: %s (%s)).\n",
+ purple_account_get_username(account),
+ purple_account_get_protocol_id(account));
+ new_error = g_error_new(PURPLE_KEYRING_ERROR,
+ PURPLE_KEYRING_ERROR_ACCESSDENIED,
+ "Secret Service is locked (account: %s).",
+ purple_account_get_username(account));
} else {
purple_debug_error("keyring-libsecret",
"Unknown error (account: %s (%s), "