diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-28 20:56:58 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-23 20:14:30 +0800 |
commit | e2df01bf85d384986dce8102c3b6bd704ea6d318 (patch) | |
tree | 44d97524d9423c3202d63596fb68a4fe0cd59eb9 /libempathy | |
parent | 80ff6670675cdfa087c92901d8d96c16f40c5613 (diff) | |
download | gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.tar gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.tar.gz gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.tar.bz2 gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.tar.lz gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.tar.xz gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.tar.zst gsoc2013-empathy-e2df01bf85d384986dce8102c3b6bd704ea6d318.zip |
server-sasl-handler: add auth-password-failed signal
https://bugzilla.gnome.org/show_bug.cgi?id=661640
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-server-sasl-handler.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libempathy/empathy-server-sasl-handler.c b/libempathy/empathy-server-sasl-handler.c index d37851405..117d88f03 100644 --- a/libempathy/empathy-server-sasl-handler.c +++ b/libempathy/empathy-server-sasl-handler.c @@ -37,6 +37,7 @@ enum { /* signal enum */ enum { + AUTH_PASSWORD_FAILED, INVALIDATED, LAST_SIGNAL, }; @@ -98,6 +99,7 @@ sasl_status_changed_cb (TpChannel *channel, gpointer user_data, GObject *weak_object) { + EmpathyServerSASLHandler *self = EMPATHY_SERVER_SASL_HANDLER (weak_object); EmpathyServerSASLHandlerPriv *priv = EMPATHY_SERVER_SASL_HANDLER (weak_object)->priv; /* buh boh */ @@ -130,6 +132,13 @@ sasl_status_changed_cb (TpChannel *channel, tp_cli_channel_call_close (priv->channel, -1, NULL, NULL, NULL, NULL); } + else if (status == TP_SASL_STATUS_SERVER_FAILED) + { + if (!tp_strdiff (error, TP_ERROR_STR_AUTHENTICATION_FAILED)) + { + g_signal_emit (self, signals[AUTH_PASSWORD_FAILED], 0, priv->password); + } + } } static gboolean @@ -333,6 +342,13 @@ empathy_server_sasl_handler_class_init (EmpathyServerSASLHandlerClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_ACCOUNT, pspec); + 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, 1, G_TYPE_STRING); + signals[INVALIDATED] = g_signal_new ("invalidated", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, |