aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-03-10 14:15:48 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-14 23:54:09 +0800
commit62b9f4d3e4263982d06efbb410643eea597c9aac (patch)
treeb106f7f2e1614d5cb214f9597981011923afdb1a
parent2b052483ca2761397678b0aed31b4699bbfadabf (diff)
downloadgsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.tar
gsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.tar.gz
gsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.tar.bz2
gsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.tar.lz
gsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.tar.xz
gsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.tar.zst
gsoc2013-empathy-62b9f4d3e4263982d06efbb410643eea597c9aac.zip
Set a fake password if we know the password is saved
-rw-r--r--libempathy-gtk/empathy-account-widget-skype.c48
1 files changed, 44 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-account-widget-skype.c b/libempathy-gtk/empathy-account-widget-skype.c
index dbe4ff69e..1cb6156da 100644
--- a/libempathy-gtk/empathy-account-widget-skype.c
+++ b/libempathy-gtk/empathy-account-widget-skype.c
@@ -147,7 +147,7 @@ auth_observer_observe_channels (TpSimpleObserver *auth_observer,
GHashTable *props;
GStrv available_mechanisms;
GtkWidget *password_entry = user_data;
- const char *password;
+ const char *password = NULL;
/* we only do this for Psyke */
if (tp_strdiff (
@@ -171,7 +171,9 @@ auth_observer_observe_channels (TpSimpleObserver *auth_observer,
goto except;
/* do we have a password */
- password = gtk_entry_get_text (GTK_ENTRY (password_entry));
+ if (g_object_get_data (G_OBJECT (password_entry), "fake-password") == NULL)
+ password = gtk_entry_get_text (GTK_ENTRY (password_entry));
+
if (tp_str_empty (password))
goto except;
@@ -352,6 +354,34 @@ account_widget_skype_set_value (EmpathyAccountWidget *self,
}
static void
+account_widget_build_skype_get_password_saved_cb (TpProxy *account,
+ const GValue *value,
+ const GError *in_error,
+ gpointer user_data,
+ GObject *password_entry)
+{
+ gboolean password_saved;
+
+ if (in_error != NULL)
+ {
+ DEBUG ("Failed to get PasswordSaved: %s", in_error->message);
+ return;
+ }
+
+ g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (value));
+
+ password_saved = g_value_get_boolean (value);
+
+ DEBUG ("PasswordSaved: %s", password_saved ? "yes" : "no");
+
+ if (password_saved)
+ gtk_entry_set_text (GTK_ENTRY (password_entry), "xxxxxxxx");
+
+ g_object_set_data (password_entry, "fake-password",
+ GUINT_TO_POINTER (password_saved));
+}
+
+static void
account_widget_build_skype_get_privacy_settings_cb (TpProxy *cm,
GHashTable *props,
const GError *in_error,
@@ -621,6 +651,7 @@ empathy_account_widget_build_skype (EmpathyAccountWidget *self,
const char *filename)
{
EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
+ TpAccount *account = empathy_account_settings_get_account (priv->settings);
GtkWidget *password_entry;
if (priv->simple || priv->creating_account)
@@ -651,8 +682,6 @@ empathy_account_widget_build_skype (EmpathyAccountWidget *self,
}
else
{
- TpAccount *account =
- empathy_account_settings_get_account (priv->settings);
GtkWidget *edit_privacy_settings_button, *skype_info;
self->ui_details->gui = empathy_builder_get_file (filename,
@@ -693,6 +722,17 @@ empathy_account_widget_build_skype (EmpathyAccountWidget *self,
* tie the lifetime of the observer to the lifetime of the widget */
g_object_set_data_full (G_OBJECT (self->ui_details->widget), "auth-observer",
auth_observer_new (password_entry), g_object_unref);
+
+ /* find out if we know the password */
+ if (tp_proxy_has_interface_by_id (account,
+ EMP_IFACE_QUARK_ACCOUNT_INTERFACE_EXTERNAL_PASSWORD_STORAGE))
+ {
+ tp_cli_dbus_properties_call_get (account, -1,
+ EMP_IFACE_ACCOUNT_INTERFACE_EXTERNAL_PASSWORD_STORAGE,
+ "PasswordSaved",
+ account_widget_build_skype_get_password_saved_cb,
+ NULL, NULL, G_OBJECT (password_entry));
+ }
}
gboolean