purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("Unable to connect to the MXit server. Please check your server settings."));
return;
}
/* we now have an open and active TCP connection to the mxit server */
session->fd=source;
/* start listening on the open connection for messages from the server (reference: "libpurple/eventloop.h") */
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("Unable to connect to the MXit server. Please check your server settings."));
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("MXit is currently unable to process the request. Please try again later."));
return;
}
/* check wapsite return code */
switch(parts[0][0]){
case'0':
/* valid reply! */
break;
case'1':
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("Wrong security code entered. Please try again later."));
return;
case'2':
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("Your session has expired. Please try again later."));
return;
case'5':
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("Invalid country selected. Please try again."));
return;
case'6':
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("The MXit ID you entered is not registered. Please register first."));
return;
case'7':
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("The MXit ID you entered is already registered. Please choose another."));
/* this user's account already exists, so we need to change the registration login flag to be login */
purple_connection_error(session->con,PURPLE_CONNECTION_ERROR_NETWORK_ERROR,_("MXit is currently unable to process the request. Please try again later."));
return;
}
/* save received settings */
logindata=g_new0(structlogin_data,1);
logindata->wapserver=g_strdup(parts[1]);
logindata->sessionid=g_strdup(parts[2]);
session->logindata=logindata;
/* now generate the popup requesting the user for action */