aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2011-01-29 00:44:56 +0800
committerJonny Lamb <jonnylamb@gnome.org>2011-01-29 00:44:56 +0800
commit935d2f62ebc72edfe86ccf4449b7d95ef758bb74 (patch)
tree4e1331f02109f40954ae8fac779b2802c91c700a /libempathy-gtk/empathy-chat.c
parent2e70e2fef401bcbe38d9caf8281992be7d0f6413 (diff)
downloadgsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.tar
gsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.tar.gz
gsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.tar.bz2
gsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.tar.lz
gsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.tar.xz
gsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.tar.zst
gsoc2013-empathy-935d2f62ebc72edfe86ccf4449b7d95ef758bb74.zip
chat: save room passwords in the keyring if requested
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 455fb0e8e..eb7325339 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -2973,6 +2973,7 @@ typedef struct
GtkWidget *label;
GtkWidget *entry;
GtkWidget *spinner;
+ gchar *password;
} PasswordData;
static void
@@ -2994,12 +2995,18 @@ remember_password_infobar_response_cb (GtkWidget *info_bar,
gint response_id,
PasswordData *data)
{
+ EmpathyChatPriv *priv = GET_PRIV (data->self);
+
if (response_id == GTK_RESPONSE_OK) {
DEBUG ("Saving room password");
- /* TODO: implement this */
+ empathy_keyring_set_room_password_async (priv->account,
+ empathy_tp_chat_get_id (priv->tp_chat),
+ data->password,
+ NULL, NULL);
}
gtk_widget_destroy (info_bar);
+ g_free (data->password);
g_slice_free (PasswordData, data);
}
@@ -3014,6 +3021,9 @@ chat_prompt_to_save_password (EmpathyChat *self,
GtkWidget *alig;
GtkWidget *button;
+ /* save the password in case it needs to be saved */
+ data->password = g_strdup (gtk_entry_get_text (GTK_ENTRY (data->entry)));
+
/* Remove all previous widgets */
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (data->info_bar));
gtk_container_forall (GTK_CONTAINER (content_area),