diff options
Diffstat (limited to 'libempathy/empathy-keyring.c')
-rw-r--r-- | libempathy/empathy-keyring.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/libempathy/empathy-keyring.c b/libempathy/empathy-keyring.c index 4923a9463..10226ac09 100644 --- a/libempathy/empathy-keyring.c +++ b/libempathy/empathy-keyring.c @@ -27,12 +27,14 @@ #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include "empathy-debug.h" -static GnomeKeyringPasswordSchema keyring_schema = +static GnomeKeyringPasswordSchema account_keyring_schema = { GNOME_KEYRING_ITEM_GENERIC_SECRET, { { "account-id", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, { "param-name", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING }, { NULL } } }; +/* get */ + static void find_items_cb (GnomeKeyringResult result, GList *list, @@ -63,7 +65,7 @@ find_items_cb (GnomeKeyringResult result, } void -empathy_keyring_get_password_async (TpAccount *account, +empathy_keyring_get_account_password_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { @@ -75,7 +77,7 @@ empathy_keyring_get_password_async (TpAccount *account, g_return_if_fail (callback != NULL); simple = g_simple_async_result_new (G_OBJECT (account), callback, - user_data, empathy_keyring_get_password_async); + user_data, empathy_keyring_get_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); @@ -94,7 +96,7 @@ empathy_keyring_get_password_async (TpAccount *account, } const gchar * -empathy_keyring_get_password_finish (TpAccount *account, +empathy_keyring_get_account_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { @@ -109,11 +111,13 @@ empathy_keyring_get_password_finish (TpAccount *account, return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_get_password_async), NULL); + G_OBJECT (account), empathy_keyring_get_room_password_async), NULL); return g_simple_async_result_get_op_res_gpointer (simple); } +/* set */ + static void store_password_cb (GnomeKeyringResult result, gpointer user_data) @@ -134,7 +138,7 @@ store_password_cb (GnomeKeyringResult result, } void -empathy_keyring_set_password_async (TpAccount *account, +empathy_keyring_set_account_password_async (TpAccount *account, const gchar *password, GAsyncReadyCallback callback, gpointer user_data) @@ -147,7 +151,7 @@ empathy_keyring_set_password_async (TpAccount *account, g_return_if_fail (password != NULL); simple = g_simple_async_result_new (G_OBJECT (account), callback, - user_data, empathy_keyring_set_password_async); + user_data, empathy_keyring_set_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); @@ -157,7 +161,7 @@ empathy_keyring_set_password_async (TpAccount *account, name = g_strdup_printf ("IM account password for %s (%s)", tp_account_get_display_name (account), account_id); - gnome_keyring_store_password (&keyring_schema, NULL, name, password, + gnome_keyring_store_password (&account_keyring_schema, NULL, name, password, store_password_cb, simple, NULL, "account-id", account_id, "param-name", "password", @@ -167,7 +171,7 @@ empathy_keyring_set_password_async (TpAccount *account, } gboolean -empathy_keyring_set_password_finish (TpAccount *account, +empathy_keyring_set_account_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { @@ -182,11 +186,13 @@ empathy_keyring_set_password_finish (TpAccount *account, return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_set_password_async), FALSE); + G_OBJECT (account), empathy_keyring_set_account_password_async), FALSE); return TRUE; } +/* delete */ + static void item_delete_cb (GnomeKeyringResult result, gpointer user_data) @@ -234,7 +240,7 @@ find_item_to_delete_cb (GnomeKeyringResult result, } void -empathy_keyring_delete_password_async (TpAccount *account, +empathy_keyring_delete_account_password_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { @@ -245,7 +251,7 @@ empathy_keyring_delete_password_async (TpAccount *account, g_return_if_fail (TP_IS_ACCOUNT (account)); simple = g_simple_async_result_new (G_OBJECT (account), callback, - user_data, empathy_keyring_delete_password_async); + user_data, empathy_keyring_delete_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); @@ -262,7 +268,7 @@ empathy_keyring_delete_password_async (TpAccount *account, } gboolean -empathy_keyring_delete_password_finish (TpAccount *account, +empathy_keyring_delete_account_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { @@ -277,7 +283,7 @@ empathy_keyring_delete_password_finish (TpAccount *account, return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_delete_password_async), FALSE); + G_OBJECT (account), empathy_keyring_delete_account_password_async), FALSE); return TRUE; } |