summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/proto.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-06-08 14:34:56 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-06-08 14:34:56 +0000
commitd0932866332ca111c02d12cefc6373feef1a90bf (patch)
tree22e70b244d7a6e16b2c7e44b3d39589c6561547d /protocols/WhatsApp/src/proto.cpp
parentb28083bc8180dbbec6a544cd058bf586b1f8adbc (diff)
i think fixed password saving
git-svn-id: http://svn.miranda-ng.org/main/trunk@4901 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/proto.cpp')
-rw-r--r--protocols/WhatsApp/src/proto.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index acfe83f5a6..260122efa1 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -253,12 +253,17 @@ string WhatsAppProto::Register(int state, string cc, string number, string code)
NETLIBHTTPREQUEST* pnlhr = (NETLIBHTTPREQUEST*) CallService(MS_NETLIB_HTTPTRANSACTION,
(WPARAM) WASocketConnection::hNetlibUser, (LPARAM)&nlhr);
+ string title = this->TranslateStr("Registration");
+ if (pnlhr == NULL) {
+ this->NotifyEvent(title, this->TranslateStr("Registration failed. Invalid server response."), NULL, WHATSAPP_EVENT_CLIENT);
+ return ret;
+ }
+
LOG("Server response: %s", pnlhr->pData);
MessageBoxA(NULL, pnlhr->pData, "Debug", MB_OK);
cJSON* resp = cJSON_Parse(pnlhr->pData);
cJSON* val;
- string title = this->TranslateStr("Registration");
// Invalid
if (resp == NULL)
@@ -304,11 +309,8 @@ string WhatsAppProto::Register(int state, string cc, string number, string code)
if (val == NULL)
{
this->NotifyEvent(title, this->TranslateStr("Registration failed."), NULL, WHATSAPP_EVENT_CLIENT);
- }
- if (strcmp(val->valuestring, "ok") == 0)
- {
+ } else
ret = val->valuestring;
- }
}
cJSON_Delete(resp);