libpurple/protocols/jabber/auth.c

changeset 17185
aee12ae11898
parent 17184
19aafbb84554
child 17272
ef1ea73b872f
child 18068
b6554e3c8224
equal deleted inserted replaced
17184:19aafbb84554 17185:aee12ae11898
64 GString *response; 64 GString *response;
65 gchar *enc_out; 65 gchar *enc_out;
66 66
67 auth = xmlnode_new("auth"); 67 auth = xmlnode_new("auth");
68 xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl"); 68 xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl");
69 69
70 xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth"); 70 xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth");
71 xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true"); 71 xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true");
72 72
73 response = g_string_new(""); 73 response = g_string_new("");
74 response = g_string_append_len(response, "\0", 1); 74 response = g_string_append_len(response, "\0", 1);
75 response = g_string_append(response, js->user->node); 75 response = g_string_append(response, js->user->node);
76 response = g_string_append_len(response, "\0", 1); 76 response = g_string_append_len(response, "\0", 1);
77 response = g_string_append(response, 77 response = g_string_append(response,
200 200
201 purple_account_set_password(js->gc->account, entry); 201 purple_account_set_password(js->gc->account, entry);
202 202
203 return TRUE; 203 return TRUE;
204 } 204 }
205 205
206 static void auth_pass_cb(JabberStream *js, PurpleRequestFields *fields) 206 static void auth_pass_cb(JabberStream *js, PurpleRequestFields *fields)
207 { 207 {
208 208
209 if (!auth_pass_generic(js, fields)) 209 if (!auth_pass_generic(js, fields))
210 return; 210 return;
219 static void 219 static void
220 auth_old_pass_cb(JabberStream *js, PurpleRequestFields *fields) 220 auth_old_pass_cb(JabberStream *js, PurpleRequestFields *fields)
221 { 221 {
222 if (!auth_pass_generic(js, fields)) 222 if (!auth_pass_generic(js, fields))
223 return; 223 return;
224 224
225 /* Restart our connection */ 225 /* Restart our connection */
226 jabber_auth_start_old(js); 226 jabber_auth_start_old(js);
227 } 227 }
228 228
229 229
593 #ifdef HAVE_CYRUS_SASL 593 #ifdef HAVE_CYRUS_SASL
594 /* If we have Cyrus SASL, then passwords will have been set 594 /* If we have Cyrus SASL, then passwords will have been set
595 * to OPTIONAL for this protocol. So, we need to do our own 595 * to OPTIONAL for this protocol. So, we need to do our own
596 * password prompting here 596 * password prompting here
597 */ 597 */
598 598
599 if (!purple_account_get_password(js->gc->account)) { 599 if (!purple_account_get_password(js->gc->account)) {
600 purple_account_request_password(js->gc->account, G_CALLBACK(auth_old_pass_cb), G_CALLBACK(auth_no_pass_cb), js); 600 purple_account_request_password(js->gc->account, G_CALLBACK(auth_old_pass_cb), G_CALLBACK(auth_no_pass_cb), js);
601 return; 601 return;
602 } 602 }
603 #endif 603 #endif

mercurial