Mercurial > pidgin
diff libpurple/protocols/jabber/auth_plain.c @ 28725:4f45aae3ace1
Let's try a more complex set of return states / values for auth mechs.
This won't build with Cyrus support yet.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Tue, 01 Dec 2009 07:32:53 +0000 |
parents | cea22db36ffc |
children | b94fd073187c |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth_plain.c Tue Dec 01 04:21:40 2009 +0000 +++ b/libpurple/protocols/jabber/auth_plain.c Tue Dec 01 07:32:53 2009 +0000 @@ -80,13 +80,16 @@ _("Server requires plaintext authentication over an unencrypted stream")); } -static xmlnode *jabber_plain_start(JabberStream *js, xmlnode *packet) +static JabberSaslState +jabber_plain_start(JabberStream *js, xmlnode *packet, xmlnode **response, const char **error) { PurpleAccount *account = purple_connection_get_account(js->gc); char *msg; - if (jabber_stream_is_ssl(js) || purple_account_get_bool(account, "auth_plain_in_clear", FALSE)) - return finish_plaintext_authentication(js); + if (jabber_stream_is_ssl(js) || purple_account_get_bool(account, "auth_plain_in_clear", FALSE)) { + *response = finish_plaintext_authentication(js); + return JABBER_SASL_STATE_OK; + } msg = g_strdup_printf(_("%s requires plaintext authentication over an unencrypted connection. Allow this and continue authentication?"), purple_account_get_username(account)); @@ -97,7 +100,7 @@ account, NULL, NULL, account, allow_plaintext_auth, disallow_plaintext_auth); g_free(msg); - return NULL; + return JABBER_SASL_STATE_CONTINUE; } static JabberSaslMech plain_mech = {