# HG changeset patch # User Andreas Monitzer # Date 1182334732 0 # Node ID 108f3b42976f8a7b7ba9eb8a3dae9439dd09c2b1 # Parent 3399dd1c258d4757401118bb17e0a185f46739a6 Introduced an additional connection stage to the jabber connection progress in order to be able to tell in the application, whether SSL/TLS is enabled, so it can display a lock icon next to the connection. diff -r 3399dd1c258d -r 108f3b42976f libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Wed Jun 20 00:25:37 2007 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed Jun 20 10:18:52 2007 +0000 @@ -58,7 +58,7 @@ #include -#define JABBER_CONNECT_STEPS (js->gsc ? 8 : 5) +#define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5) static PurplePlugin *my_protocol = NULL; GList *jabber_features; @@ -453,11 +453,14 @@ } js = gc->proto_data; - + if(js->state == JABBER_STREAM_CONNECTING) jabber_send_raw(js, "", -1); jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING); purple_ssl_input_add(gsc, jabber_recv_cb_ssl, gc); + + /* Tell the app that we're doing encryption */ + jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING_ENCRYPTION); } @@ -1134,9 +1137,14 @@ js->gsc ? 5 : 2, JABBER_CONNECT_STEPS); jabber_stream_init(js); break; + case JABBER_STREAM_INITIALIZING_ENCRYPTION: + purple_connection_update_progress(js->gc, _("Initializing SSL/TLS"), + 6, JABBER_CONNECT_STEPS); + jabber_stream_init(js); + break; case JABBER_STREAM_AUTHENTICATING: purple_connection_update_progress(js->gc, _("Authenticating"), - js->gsc ? 6 : 3, JABBER_CONNECT_STEPS); + js->gsc ? 7 : 3, JABBER_CONNECT_STEPS); if(js->protocol_version == JABBER_PROTO_0_9 && js->registration) { jabber_register_start(js); } else if(js->auth_type == JABBER_AUTH_IQ_AUTH) { @@ -1145,7 +1153,7 @@ break; case JABBER_STREAM_REINITIALIZING: purple_connection_update_progress(js->gc, _("Re-initializing Stream"), - (js->gsc ? 7 : 4), JABBER_CONNECT_STEPS); + (js->gsc ? 8 : 4), JABBER_CONNECT_STEPS); /* The stream will be reinitialized later, in jabber_recv_cb_ssl() */ js->reinit = TRUE; diff -r 3399dd1c258d -r 108f3b42976f libpurple/protocols/jabber/jabber.h --- a/libpurple/protocols/jabber/jabber.h Wed Jun 20 00:25:37 2007 +0000 +++ b/libpurple/protocols/jabber/jabber.h Wed Jun 20 10:18:52 2007 +0000 @@ -69,6 +69,7 @@ JABBER_STREAM_OFFLINE, JABBER_STREAM_CONNECTING, JABBER_STREAM_INITIALIZING, + JABBER_STREAM_INITIALIZING_ENCRYPTION, JABBER_STREAM_AUTHENTICATING, JABBER_STREAM_REINITIALIZING, JABBER_STREAM_CONNECTED diff -r 3399dd1c258d -r 108f3b42976f libpurple/protocols/jabber/parser.c --- a/libpurple/protocols/jabber/parser.c Wed Jun 20 00:25:37 2007 +0000 +++ b/libpurple/protocols/jabber/parser.c Wed Jun 20 10:18:52 2007 +0000 @@ -63,7 +63,7 @@ if(js->protocol_version == JABBER_PROTO_0_9) js->auth_type = JABBER_AUTH_IQ_AUTH; - if(js->state == JABBER_STREAM_INITIALIZING) + if(js->state == JABBER_STREAM_INITIALIZING || js->state == JABBER_STREAM_INITIALIZING_ENCRYPTION) jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING); } else {