comparison libpurple/protocols/mxit/protocol.c @ 30296:1147389b5424

When logging-in with the HTTP protocol, we need to save the HTTP info (server address, session id) *before* checking the current presence state. Otherwise mxit_send_presence() might be called which will generate and send an invalid MXit HTTP packet.
author andrew.victor@mxit.com
date Tue, 04 May 2010 21:09:52 +0000
parents 81ea740f92a4
children 4232e6b27bea
comparison
equal deleted inserted replaced
30286:ce52e101844a 30296:1147389b5424
1264 /* we were not yet logged in so we need to complete the login sequence here */ 1264 /* we were not yet logged in so we need to complete the login sequence here */
1265 session->flags |= MXIT_FLAG_LOGGEDIN; 1265 session->flags |= MXIT_FLAG_LOGGEDIN;
1266 purple_connection_update_progress( session->con, _( "Successfully Logged In..." ), 3, 4 ); 1266 purple_connection_update_progress( session->con, _( "Successfully Logged In..." ), 3, 4 );
1267 purple_connection_set_state( session->con, PURPLE_CONNECTED ); 1267 purple_connection_set_state( session->con, PURPLE_CONNECTED );
1268 1268
1269 /* save extra info if this is a HTTP connection */
1270 if ( session->http ) {
1271 /* save the http server to use for this session */
1272 g_strlcpy( session->http_server, records[1]->fields[3]->data, sizeof( session->http_server ) );
1273
1274 /* save the session id */
1275 session->http_sesid = atoi( records[0]->fields[0]->data );
1276 }
1277
1269 /* display the current splash-screen */ 1278 /* display the current splash-screen */
1270 if ( splash_popup_enabled( session ) ) 1279 if ( splash_popup_enabled( session ) )
1271 splash_display( session ); 1280 splash_display( session );
1272 1281
1273 /* update presence status */ 1282 /* update presence status */
1286 1295
1287 mxit_send_presence( session, presence, statusmsg2 ); 1296 mxit_send_presence( session, presence, statusmsg2 );
1288 1297
1289 g_free( statusmsg1 ); 1298 g_free( statusmsg1 );
1290 g_free( statusmsg2 ); 1299 g_free( statusmsg2 );
1291 }
1292
1293 /* save extra info if this is a HTTP connection */
1294 if ( session->http ) {
1295 /* save the http server to use for this session */
1296 g_strlcpy( session->http_server, records[1]->fields[3]->data, sizeof( session->http_server ) );
1297
1298 /* save the session id */
1299 session->http_sesid = atoi( records[0]->fields[0]->data );
1300 } 1300 }
1301 1301
1302 /* retrieve our MXit profile */ 1302 /* retrieve our MXit profile */
1303 mxit_send_extprofile_request( session, NULL, ARRAY_SIZE( profilelist ), profilelist ); 1303 mxit_send_extprofile_request( session, NULL, ARRAY_SIZE( profilelist ), profilelist );
1304 } 1304 }