diff options
author | Fishbone <fishbone@miranda-ng.org> | 2013-06-03 13:55:50 +0000 |
---|---|---|
committer | Fishbone <fishbone@miranda-ng.org> | 2013-06-03 13:55:50 +0000 |
commit | 70e02c41dc4693a742dda252557588947e6be37a (patch) | |
tree | 7485ecd628e6e6a96943660872167dc5771f9b9a /protocols/WhatsApp/src/proto.cpp | |
parent | 9f631693a3094124ac7f34f1fa34008116ba6afc (diff) |
WhatsApp:
* Tried fixing requesting registration code
* Started removing Miranda dependecies in WhatsAPI++
git-svn-id: http://svn.miranda-ng.org/main/trunk@4871 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/proto.cpp')
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index e73e37ece0..29be123437 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -180,15 +180,15 @@ void WhatsAppProto::RequestCode() if ( !db_get_s(NULL,m_szModuleName,WHATSAPP_KEY_IDX,&dbv,DBVT_ASCIIZ))
{
idx = dbv.pszVal;
- if (idx.empty())
- {
- std::stringstream tm;
- tm << time(NULL);
- BYTE idxBuf[16];
- utils::md5string(tm.str(), idxBuf);
- idx = std::string((const char*) idxBuf, 16);
- db_set_s(0, m_szModuleName,WHATSAPP_KEY_IDX, idx.c_str());
- }
+ }
+ if (idx.empty())
+ {
+ std::stringstream tm;
+ tm << time(NULL);
+ BYTE idxBuf[16];
+ utils::md5string(tm.str(), idxBuf);
+ idx = std::string((const char*) idxBuf, 16);
+ db_set_s(0, m_szModuleName,WHATSAPP_KEY_IDX, idx.c_str());
}
if ( !db_get_s(NULL,m_szModuleName,WHATSAPP_KEY_CC,&dbv, DBVT_ASCIIZ))
{
@@ -229,17 +229,19 @@ void WhatsAppProto::RequestCode() NETLIBHTTPREQUEST nlhr = {sizeof(NETLIBHTTPREQUEST)};
nlhr.requestType = REQUEST_POST;
- nlhr.szUrl = (char*) (std::string(ACCOUNT_URL_CODEREQUESTV2) + "?cc="+ cc + "&in="+ number +
- "lc=US&lg=en&mcc=000&mnc=000&method=sms&id=" + idx + "&token="+ token).c_str();
+ string url = std::string(ACCOUNT_URL_CODEREQUESTV2);
+ url += "?cc="+ cc + "&in="+ number +
+ "&lc=US&lg=en&mcc=000&mnc=000&method=sms&id=" + idx + "&token="+ token;
+ nlhr.szUrl = (char*) url.c_str();
nlhr.headers = &headers[0];
nlhr.headersCount = 3;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_GENERATEHOST | NLHRF_REMOVEHOST;
-
- return;
+ nlhr.flags = NLHRF_HTTP11 | NLHRF_GENERATEHOST | NLHRF_REMOVEHOST | NLHRF_SSL;
NETLIBHTTPREQUEST* pnlhr = (NETLIBHTTPREQUEST*) CallService(MS_NETLIB_HTTPTRANSACTION,
(WPARAM) WASocketConnection::hNetlibUser, (LPARAM)&nlhr);
+ MessageBoxA(NULL, pnlhr->pData, "Debug", MB_OK);
+
// #TODO
}
|