diff options
author | Robert Pösel <robyer@seznam.cz> | 2012-09-09 07:29:38 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2012-09-09 07:29:38 +0000 |
commit | dee5ce2a65db4c11371a565cbfac0fe082949776 (patch) | |
tree | dfc93f0816b5498392bcfd6181a9bd747a6bd442 /protocols | |
parent | d3d721fc3dc0702aa06e44a022824ad5df4267b7 (diff) |
Partial fix for setting machine name at login.
Miranda IM -> Miranda NG
git-svn-id: http://svn.miranda-ng.org/main/trunk@1550 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/FacebookRM/client.h | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/communication.cpp | 16 | ||||
-rw-r--r-- | protocols/FacebookRM/main.cpp | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/protocols/FacebookRM/client.h b/protocols/FacebookRM/client.h index 2e854c2c98..d11cf0ab55 100644 --- a/protocols/FacebookRM/client.h +++ b/protocols/FacebookRM/client.h @@ -164,7 +164,7 @@ public: // HTTP communication
- http::response flap( const int request_type, std::string* request_data = NULL, std::string* request_get_data = NULL );
+ http::response flap( const int request_type, std::string* request_data = NULL, std::string* request_get_data = NULL, int method = 0 );
bool save_url(const std::string &url,const std::tstring &filename, HANDLE &nlc);
DWORD choose_security_level( int );
diff --git a/protocols/FacebookRM/communication.cpp b/protocols/FacebookRM/communication.cpp index 7cbaed3f8d..5f61fee42d 100644 --- a/protocols/FacebookRM/communication.cpp +++ b/protocols/FacebookRM/communication.cpp @@ -27,10 +27,10 @@ void facebook_client::client_notify( TCHAR* message ) parent->NotifyEvent( parent->m_tszUserName, message, NULL, FACEBOOK_EVENT_CLIENT );
}
-http::response facebook_client::flap( const int request_type, std::string* request_data, std::string* request_get_data )
+http::response facebook_client::flap( const int request_type, std::string* request_data, std::string* request_get_data, int method )
{
NETLIBHTTPREQUEST nlhr = {sizeof( NETLIBHTTPREQUEST )};
- nlhr.requestType = choose_method( request_type );
+ nlhr.requestType = !method ? choose_method( request_type ) : method;
std::string url = choose_request_url( request_type, request_data, request_get_data );
nlhr.szUrl = (char*)url.c_str( );
nlhr.flags = NLHRF_HTTP11 | NLHRF_NODUMP | choose_security_level( request_type );
@@ -615,31 +615,31 @@ bool facebook_client::login(const std::string &username,const std::string &passw // Check whether setting Machine name is required
if ( resp.headers["Location"].find("/checkpoint/") != std::string::npos )
{
- resp = flap( FACEBOOK_REQUEST_SETUP_MACHINE );
+ resp = flap( FACEBOOK_REQUEST_SETUP_MACHINE, NULL, NULL, REQUEST_GET );
std::string inner_data;
if (resp.data.find("name=\"submit[Continue]\"") != std::string::npos) {
// Multi step with approving last unrecognized device
// 1) Continue
inner_data = "submit[Continue]=Continue";
- inner_data += "&lsd=" + utils::text::source_get_value(&resp.data, 3, "name=\"lsd\"", "value=\"", "\"" );
inner_data += "&nh=" + utils::text::source_get_value(&resp.data, 3, "name=\"nh\"", "value=\"", "\"" );
+ inner_data += "&fb_dtsg=" + utils::text::source_get_value(&resp.data, 3, "name=\"fb_dtsg\"", "value=\"", "\"" );
resp = flap( FACEBOOK_REQUEST_SETUP_MACHINE, &inner_data );
// 2) Approve last unknown login
// inner_data = "submit[I%20don't%20recognize]=I%20don't%20recognize"; // Don't recognize - this will force to change account password
inner_data = "submit[This%20is%20Okay]=This%20is%20Okay"; // Recognize
- inner_data += "&lsd=" + utils::text::source_get_value(&resp.data, 3, "name=\"lsd\"", "value=\"", "\"" );
inner_data += "&nh=" + utils::text::source_get_value(&resp.data, 3, "name=\"nh\"", "value=\"", "\"" );
+ inner_data += "&fb_dtsg=" + utils::text::source_get_value(&resp.data, 3, "name=\"fb_dtsg\"", "value=\"", "\"" );
resp = flap( FACEBOOK_REQUEST_SETUP_MACHINE, &inner_data );
}
// Save actual machine name
- // inner_data = "machine_name=Miranda%20IM&submit[Don't%20Save]=Don't%20Save"; // Don't save
- inner_data = "machine_name=Miranda%20IM&submit[Save%20Device]=Save%20Device"; // Save
- inner_data += "&post_form_id=" + utils::text::source_get_value(&resp.data, 3, "name=\"post_form_id\"", "value=\"", "\"" );
+ // inner_data = "machine_name=Miranda%20NG&submit[Don't%20Save]=Don't%20Save"; // Don't save
+ inner_data = "machine_name=Miranda%20NG&submit[Save%20Device]=Save%20Device"; // Save
inner_data += "&lsd=" + utils::text::source_get_value(&resp.data, 3, "name=\"lsd\"", "value=\"", "\"" );
inner_data += "&nh=" + utils::text::source_get_value(&resp.data, 3, "name=\"nh\"", "value=\"", "\"" );
+ inner_data += "&fb_dtsg=" + utils::text::source_get_value(&resp.data, 3, "name=\"fb_dtsg\"", "value=\"", "\"" );
resp = flap( FACEBOOK_REQUEST_SETUP_MACHINE, &inner_data );
validate_response(&resp);
diff --git a/protocols/FacebookRM/main.cpp b/protocols/FacebookRM/main.cpp index 9e58374232..5928b85499 100644 --- a/protocols/FacebookRM/main.cpp +++ b/protocols/FacebookRM/main.cpp @@ -113,7 +113,7 @@ extern "C" int __declspec(dllexport) Load(void) {
std::stringstream agent;
// DWORD mir_ver = ( DWORD )CallService( MS_SYSTEM_GETVERSION, NULL, NULL );
- agent << "MirandaIM/";
+ agent << "MirandaNG/";
agent << (( g_mirandaVersion >> 24) & 0xFF);
agent << ".";
agent << (( g_mirandaVersion >> 16) & 0xFF);
|