void empathy_keyring_delete_account_password_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; const gchar *account_id; g_return_if_fail (TP_IS_ACCOUNT (account)); simple = g_simple_async_result_new (G_OBJECT (account), callback, user_data, empathy_keyring_delete_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); DEBUG ("Deleting password for %s", account_id); const gchar *provider; provider = tp_account_get_storage_provider (account); if (!tp_strdiff (provider, EMPATHY_UOA_PROVIDER)) { /* I see no other way to forget the stored password than overwriting * with an empty one. */ uoa_set_account_password (account, "", FALSE, simple); g_object_unref (simple); return; } g_object_unref(simple); }
void empathy_keyring_set_account_password_async (TpAccount *account, const gchar *password, gboolean remember, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; const gchar *account_id; gchar *name; g_return_if_fail (TP_IS_ACCOUNT (account)); g_return_if_fail (password != NULL); simple = g_simple_async_result_new (G_OBJECT (account), callback, user_data, empathy_keyring_set_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); DEBUG ("Remembering password for %s", account_id); const gchar *provider; provider = tp_account_get_storage_provider (account); if (!tp_strdiff (provider, EMPATHY_UOA_PROVIDER)) { uoa_set_account_password (account, password, remember, simple); g_object_unref (simple); return; } g_object_unref(simple); }
void tpaw_keyring_set_account_password_async (TpAccount *account, const gchar *password, gboolean remember, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; const gchar *account_id; gchar *name; g_return_if_fail (TP_IS_ACCOUNT (account)); g_return_if_fail (password != NULL); simple = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tpaw_keyring_set_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); DEBUG ("Remembering password for %s", account_id); #ifdef HAVE_UOA { const gchar *provider; provider = tp_account_get_storage_provider (account); if (!tp_strdiff (provider, TPAW_UOA_PROVIDER)) { uoa_set_account_password (account, password, remember, simple); g_object_unref (simple); return; } } #endif name = g_strdup_printf (_("IM account password for %s (%s)"), tp_account_get_display_name (account), account_id); secret_password_store (&account_keyring_schema, remember ? NULL : SECRET_COLLECTION_SESSION, name, password, NULL, store_password_cb, simple, "account-id", account_id, "param-name", "password", NULL); g_free (name); }
void tpaw_keyring_delete_account_password_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; const gchar *account_id; g_return_if_fail (TP_IS_ACCOUNT (account)); simple = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tpaw_keyring_delete_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); DEBUG ("Deleting password for %s", account_id); #ifdef HAVE_UOA { const gchar *provider; provider = tp_account_get_storage_provider (account); if (!tp_strdiff (provider, TPAW_UOA_PROVIDER)) { /* I see no other way to forget the stored password than overwriting * with an empty one. */ uoa_set_account_password (account, "", FALSE, simple); g_object_unref (simple); return; } } #endif secret_password_clear (&account_keyring_schema, NULL, items_delete_cb, simple, "account-id", account_id, "param-name", "password", NULL); }
gboolean empathy_uoa_auth_handler_supports (EmpathyUoaAuthHandler *self, TpChannel *channel, TpAccount *account) { const gchar *provider; EmpathySaslMechanism mech; g_return_val_if_fail (TP_IS_CHANNEL (channel), FALSE); g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); provider = tp_account_get_storage_provider (account); if (tp_strdiff (provider, EMPATHY_UOA_PROVIDER)) return FALSE; mech = empathy_sasl_channel_select_mechanism (channel); return mech == EMPATHY_SASL_MECHANISM_FACEBOOK || mech == EMPATHY_SASL_MECHANISM_WLM || mech == EMPATHY_SASL_MECHANISM_GOOGLE || mech == EMPATHY_SASL_MECHANISM_PASSWORD; }
void tpaw_keyring_get_account_password_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; const gchar *account_id; g_return_if_fail (TP_IS_ACCOUNT (account)); g_return_if_fail (callback != NULL); simple = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tpaw_keyring_get_account_password_async); account_id = tp_proxy_get_object_path (account) + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); DEBUG ("Trying to get password for: %s", account_id); #ifdef HAVE_UOA { const gchar *provider; provider = tp_account_get_storage_provider (account); if (!tp_strdiff (provider, TPAW_UOA_PROVIDER)) { uoa_get_account_password (account, simple); g_object_unref (simple); return; } } #endif secret_password_lookup (&account_keyring_schema, NULL, lookup_item_cb, simple, "account-id", account_id, "param-name", "password", NULL); }