comparison libpurple/protocols/jabber/auth.c @ 29097:cea22db36ffc

jabber: Use NS_XMPP_SASL
author Paul Aurich <paul@darkrain42.org>
date Fri, 27 Nov 2009 20:41:22 +0000
parents c1d41b7484ff
children 4f45aae3ace1
comparison
equal deleted inserted replaced
29096:d9c70a78fad5 29097:cea22db36ffc
109 purple_connection_error_reason(purple_account_get_connection(account), 109 purple_connection_error_reason(purple_account_get_connection(account),
110 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, 110 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
111 _("Server requires plaintext authentication over an unencrypted stream")); 111 _("Server requires plaintext authentication over an unencrypted stream"));
112 } 112 }
113 113
114 #ifdef HAVE_CYRUS_SASL
114 static void 115 static void
115 auth_old_pass_cb(PurpleConnection *gc, PurpleRequestFields *fields) 116 auth_old_pass_cb(PurpleConnection *gc, PurpleRequestFields *fields)
116 { 117 {
117 PurpleAccount *account; 118 PurpleAccount *account;
118 JabberStream *js; 119 JabberStream *js;
152 return; 153 return;
153 154
154 /* Disable the account as the user has canceled connecting */ 155 /* Disable the account as the user has canceled connecting */
155 purple_account_set_enabled(purple_connection_get_account(gc), purple_core_get_ui(), FALSE); 156 purple_account_set_enabled(purple_connection_get_account(gc), purple_core_get_ui(), FALSE);
156 } 157 }
158 #endif
157 159
158 void 160 void
159 jabber_auth_start(JabberStream *js, xmlnode *packet) 161 jabber_auth_start(JabberStream *js, xmlnode *packet)
160 { 162 {
161 GSList *mechanisms = NULL; 163 GSList *mechanisms = NULL;
401 void 403 void
402 jabber_auth_handle_challenge(JabberStream *js, xmlnode *packet) 404 jabber_auth_handle_challenge(JabberStream *js, xmlnode *packet)
403 { 405 {
404 const char *ns = xmlnode_get_namespace(packet); 406 const char *ns = xmlnode_get_namespace(packet);
405 407
406 if (!purple_strequal(ns, "urn:ietf:params:xml:ns:xmpp-sasl")) { 408 if (!purple_strequal(ns, NS_XMPP_SASL)) {
407 purple_connection_error_reason(js->gc, 409 purple_connection_error_reason(js->gc,
408 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 410 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
409 _("Invalid response from server")); 411 _("Invalid response from server"));
410 return; 412 return;
411 } 413 }
422 424
423 void jabber_auth_handle_success(JabberStream *js, xmlnode *packet) 425 void jabber_auth_handle_success(JabberStream *js, xmlnode *packet)
424 { 426 {
425 const char *ns = xmlnode_get_namespace(packet); 427 const char *ns = xmlnode_get_namespace(packet);
426 428
427 if (!purple_strequal(ns, "urn:ietf:params:xml:ns:xmpp-sasl")) { 429 if (!purple_strequal(ns, NS_XMPP_SASL)) {
428 purple_connection_error_reason(js->gc, 430 purple_connection_error_reason(js->gc,
429 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 431 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
430 _("Invalid response from server")); 432 _("Invalid response from server"));
431 return; 433 return;
432 } 434 }