diff options
author | George Hazan <george.hazan@gmail.com> | 2014-09-19 19:09:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-09-19 19:09:07 +0000 |
commit | 41de1ce748d969a65bbefc6987c98d4e0a5010a3 (patch) | |
tree | 7568765f0ebf66fa54fa470f4eee22251301bc58 /protocols/WhatsApp/src/connection.cpp | |
parent | 5148c6e14bc21f758810aafff715bc4121c80d57 (diff) |
merge #2
git-svn-id: http://svn.miranda-ng.org/main/trunk@10527 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/connection.cpp')
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index a76ad89522..27af21cebb 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -33,51 +33,43 @@ void WhatsAppProto::ChangeStatus(void*) void WhatsAppProto::stayConnectedLoop(void*)
{
- bool error = true;
std::string cc, in, pass;
DBVARIANT dbv = { 0 };
if (!getString(WHATSAPP_KEY_CC, &dbv)) {
cc = dbv.pszVal;
db_free(&dbv);
- error = cc.empty();
}
- if (error) {
+ if (cc.empty()) {
NotifyEvent(m_tszUserName, TranslateT("Please enter a country-code."), NULL, WHATSAPP_EVENT_CLIENT);
return;
}
- error = true;
if (!getString(WHATSAPP_KEY_LOGIN, &dbv)) {
in = dbv.pszVal;
db_free(&dbv);
- error = in.empty();
}
- if (error) {
+ if (in.empty()) {
NotifyEvent(m_tszUserName, TranslateT("Please enter a phone-number without country code."), NULL, WHATSAPP_EVENT_CLIENT);
return;
}
this->phoneNumber = cc + in;
this->jid = this->phoneNumber + "@s.whatsapp.net";
- error = true;
if (!getString(WHATSAPP_KEY_NICK, &dbv)) {
this->nick = dbv.pszVal;
db_free(&dbv);
- error = nick.empty();
}
- if (error) {
+ if (nick.empty()) {
NotifyEvent(m_tszUserName, TranslateT("Please enter a nickname."), NULL, WHATSAPP_EVENT_CLIENT);
return;
}
- error = true;
if (!getString(WHATSAPP_KEY_PASS, &dbv)) {
pass = dbv.pszVal;
db_free(&dbv);
- error = pass.empty();
}
- if (error) {
+ if (pass.empty()) {
NotifyEvent(m_tszUserName, TranslateT("Please enter a password."), NULL, WHATSAPP_EVENT_CLIENT);
return;
}
@@ -87,6 +79,7 @@ void WhatsAppProto::stayConnectedLoop(void*) Mutex writerMutex;
WALogin* login = NULL;
int desiredStatus;
+ bool error = false;
this->conn = NULL;
|