Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 29078:8ada06fb65ed
jabber: Factor the SASL auth methods into their own files.
This works with and without Cyrus SASL, though there's room for cleanup
and de-duplication (some code is now duplicated between auth.c and
auth_cyrus.c).
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 07 Nov 2009 06:10:17 +0000 |
parents | 96ba7fd24177 |
children | c1d41b7484ff |
comparison
equal
deleted
inserted
replaced
28901:13e668ef158d | 29078:8ada06fb65ed |
---|---|
231 } else /* if(xmlnode_get_child_with_namespace(packet, "auth")) */ { | 231 } else /* if(xmlnode_get_child_with_namespace(packet, "auth")) */ { |
232 /* If we get an empty stream:features packet, or we explicitly get | 232 /* If we get an empty stream:features packet, or we explicitly get |
233 * an auth feature with namespace http://jabber.org/features/iq-auth | 233 * an auth feature with namespace http://jabber.org/features/iq-auth |
234 * we should revert back to iq:auth authentication, even though we're | 234 * we should revert back to iq:auth authentication, even though we're |
235 * connecting to an XMPP server. */ | 235 * connecting to an XMPP server. */ |
236 js->auth_type = JABBER_AUTH_IQ_AUTH; | |
237 jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); | 236 jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); |
237 jabber_auth_start_old(js); | |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 static void jabber_stream_handle_error(JabberStream *js, xmlnode *packet) | 241 static void jabber_stream_handle_error(JabberStream *js, xmlnode *packet) |
242 { | 242 { |
1575 6, JABBER_CONNECT_STEPS); | 1575 6, JABBER_CONNECT_STEPS); |
1576 break; | 1576 break; |
1577 case JABBER_STREAM_AUTHENTICATING: | 1577 case JABBER_STREAM_AUTHENTICATING: |
1578 purple_connection_update_progress(js->gc, _("Authenticating"), | 1578 purple_connection_update_progress(js->gc, _("Authenticating"), |
1579 js->gsc ? 7 : 3, JABBER_CONNECT_STEPS); | 1579 js->gsc ? 7 : 3, JABBER_CONNECT_STEPS); |
1580 if(js->protocol_version == JABBER_PROTO_0_9 && js->registration) { | |
1581 jabber_register_start(js); | |
1582 } else if(js->auth_type == JABBER_AUTH_IQ_AUTH) { | |
1583 jabber_auth_start_old(js); | |
1584 } | |
1585 break; | 1580 break; |
1586 case JABBER_STREAM_POST_AUTH: | 1581 case JABBER_STREAM_POST_AUTH: |
1587 purple_connection_update_progress(js->gc, _("Re-initializing Stream"), | 1582 purple_connection_update_progress(js->gc, _("Re-initializing Stream"), |
1588 (js->gsc ? 8 : 4), JABBER_CONNECT_STEPS); | 1583 (js->gsc ? 8 : 4), JABBER_CONNECT_STEPS); |
1589 | 1584 |
3461 jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, jabber_video_enabled); | 3456 jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, jabber_video_enabled); |
3462 jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0); | 3457 jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0); |
3463 jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0); | 3458 jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0); |
3464 #endif | 3459 #endif |
3465 | 3460 |
3461 jabber_auth_init(); | |
3462 | |
3466 /* IPC functions */ | 3463 /* IPC functions */ |
3467 purple_plugin_ipc_register(plugin, "contact_has_feature", PURPLE_CALLBACK(jabber_ipc_contact_has_feature), | 3464 purple_plugin_ipc_register(plugin, "contact_has_feature", PURPLE_CALLBACK(jabber_ipc_contact_has_feature), |
3468 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER, | 3465 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER, |
3469 purple_value_new(PURPLE_TYPE_BOOLEAN), 3, | 3466 purple_value_new(PURPLE_TYPE_BOOLEAN), 3, |
3470 purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_ACCOUNT), | 3467 purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_ACCOUNT), |
3495 void | 3492 void |
3496 jabber_uninit_plugin(PurplePlugin *plugin) | 3493 jabber_uninit_plugin(PurplePlugin *plugin) |
3497 { | 3494 { |
3498 purple_plugin_ipc_unregister_all(plugin); | 3495 purple_plugin_ipc_unregister_all(plugin); |
3499 | 3496 |
3497 jabber_auth_uninit(); | |
3500 jabber_features_destroy(); | 3498 jabber_features_destroy(); |
3501 jabber_identities_destroy(); | 3499 jabber_identities_destroy(); |
3502 } | 3500 } |