aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-12-07 19:54:33 +0800
committerJonny Lamb <jonnylamb@gnome.org>2010-12-07 19:54:33 +0800
commit6c5839c976407292715daf22cdddf6aca469fa75 (patch)
tree70b451c081480d4fd40bdb3ecbefce12290e1087 /src
parent9d40a77fae9175d7932c3af0e95cbdf1cfde433b (diff)
parenteb3f7d2fb30be62b801b6086143fb476b5368b5d (diff)
downloadgsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.tar
gsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.tar.gz
gsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.tar.bz2
gsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.tar.lz
gsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.tar.xz
gsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.tar.zst
gsoc2013-empathy-6c5839c976407292715daf22cdddf6aca469fa75.zip
Merge branch 'sasl'
Diffstat (limited to 'src')
-rw-r--r--src/empathy-auth-client.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/empathy-auth-client.c b/src/empathy-auth-client.c
index 17b66a57d..98a736fb9 100644
--- a/src/empathy-auth-client.c
+++ b/src/empathy-auth-client.c
@@ -29,9 +29,12 @@
#define DEBUG_FLAG EMPATHY_DEBUG_TLS
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-auth-factory.h>
+#include <libempathy/empathy-server-sasl-handler.h>
#include <libempathy/empathy-server-tls-handler.h>
#include <libempathy/empathy-tls-verifier.h>
+#include <libempathy/empathy-utils.h>
+#include <libempathy-gtk/empathy-password-dialog.h>
#include <libempathy-gtk/empathy-tls-dialog.h>
#include <libempathy-gtk/empathy-ui-utils.h>
@@ -180,7 +183,7 @@ verifier_verify_cb (GObject *source,
}
static void
-auth_factory_new_handler_cb (EmpathyAuthFactory *factory,
+auth_factory_new_tls_handler_cb (EmpathyAuthFactory *factory,
EmpathyServerTLSHandler *handler,
gpointer user_data)
{
@@ -204,6 +207,23 @@ auth_factory_new_handler_cb (EmpathyAuthFactory *factory,
g_free (hostname);
}
+static void
+auth_factory_new_sasl_handler_cb (EmpathyAuthFactory *factory,
+ EmpathyServerSASLHandler *handler,
+ gpointer user_data)
+{
+ GtkWidget *dialog;
+
+ DEBUG ("New SASL server handler received from the factory");
+
+ /* If the handler has the password it will deal with it itself. */
+ if (!empathy_server_sasl_handler_has_password (handler))
+ {
+ dialog = empathy_password_dialog_new (handler);
+ gtk_widget_show (dialog);
+ }
+}
+
int
main (int argc,
char **argv)
@@ -238,7 +258,10 @@ main (int argc,
factory = empathy_auth_factory_dup_singleton ();
g_signal_connect (factory, "new-server-tls-handler",
- G_CALLBACK (auth_factory_new_handler_cb), NULL);
+ G_CALLBACK (auth_factory_new_tls_handler_cb), NULL);
+
+ g_signal_connect (factory, "new-server-sasl-handler",
+ G_CALLBACK (auth_factory_new_sasl_handler_cb), NULL);
if (!empathy_auth_factory_register (factory, &error))
{