From e981a1084ec54ecff03ab234a666ce3742f163ae Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 28 Oct 2011 15:00:40 +0200 Subject: auth-factory: relay the auth-password-failed signal https://bugzilla.gnome.org/show_bug.cgi?id=661640 --- libempathy/empathy-auth-factory.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libempathy') diff --git a/libempathy/empathy-auth-factory.c b/libempathy/empathy-auth-factory.c index d88e9bfd8..0aaea1c4a 100644 --- a/libempathy/empathy-auth-factory.c +++ b/libempathy/empathy-auth-factory.c @@ -59,6 +59,7 @@ struct _EmpathyAuthFactoryPriv { enum { NEW_SERVER_TLS_HANDLER, NEW_SERVER_SASL_HANDLER, + AUTH_PASSWORD_FAILED, LAST_SIGNAL, }; @@ -145,6 +146,18 @@ sasl_handler_invalidated_cb (EmpathyServerSASLHandler *handler, g_hash_table_remove (priv->sasl_handlers, tp_proxy_get_object_path (channel)); } +static void +sasl_handler_auth_password_failed_cb (EmpathyServerSASLHandler *handler, + const gchar *password, + EmpathyAuthFactory *self) +{ + TpAccount *account; + + account = empathy_server_sasl_handler_get_account (handler); + + g_signal_emit (self, signals[AUTH_PASSWORD_FAILED], 0, account, password); +} + static void server_sasl_handler_ready_cb (GObject *source, GAsyncResult *res, @@ -185,6 +198,9 @@ server_sasl_handler_ready_cb (GObject *source, tp_g_signal_connect_object (handler, "invalidated", G_CALLBACK (sasl_handler_invalidated_cb), data->self, 0); + tp_g_signal_connect_object (handler, "auth-password-failed", + G_CALLBACK (sasl_handler_auth_password_failed_cb), data->self, 0); + g_signal_emit (data->self, signals[NEW_SERVER_SASL_HANDLER], 0, handler); } @@ -626,6 +642,15 @@ empathy_auth_factory_class_init (EmpathyAuthFactoryClass *klass) g_cclosure_marshal_generic, G_TYPE_NONE, 1, EMPATHY_TYPE_SERVER_SASL_HANDLER); + + signals[AUTH_PASSWORD_FAILED] = + g_signal_new ("auth-password-failed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, + NULL, NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, TP_TYPE_ACCOUNT, G_TYPE_STRING); } EmpathyAuthFactory * -- cgit v1.2.3