diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-06-10 15:09:08 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-06-10 15:09:08 +0000 |
commit | cdf4d005c67b8b5ef62170ccd4fdd29579965d9c (patch) | |
tree | f38e6b34bca9be3054031ffdbcc85457796cda08 /protocols/WhatsApp/src/connection.cpp | |
parent | f57abcc041abea72297fa3571cc07e46cf9802cd (diff) |
removed password field, coz we can't change it
added checkbutton for using 443 port
git-svn-id: http://svn.miranda-ng.org/main/trunk@4910 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/connection.cpp')
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index 7ec41e27e4..39cbf96e54 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -143,13 +143,23 @@ void WhatsAppProto::stayConnectedLoop(void*) CODE_BLOCK_TRY
- this->conn = new WASocketConnection("c.whatsapp.net", 5222);
+ BYTE UseSSL = db_get_b(NULL, this->ModuleName(), WHATSAPP_KEY_SSL, 0);
+ if (UseSSL) {
+ this->conn = new WASocketConnection("c.whatsapp.net", 443);
+
+ connection = new WAConnection(&this->connMutex, this, this);
+ login = new WALogin(connection, new BinTreeNodeReader(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN),
+ new BinTreeNodeWriter(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN, &writerMutex),
+ "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-443", base64_decode(pass), nick);
+ } else {
+ this->conn = new WASocketConnection("c.whatsapp.net", 5222);
+
+ connection = new WAConnection(&this->connMutex, this, this);
+ login = new WALogin(connection, new BinTreeNodeReader(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN),
+ new BinTreeNodeWriter(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN, &writerMutex),
+ "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-5222", base64_decode(pass), nick);
+ }
- connection = new WAConnection(&this->connMutex, this, this);
- login = new WALogin(connection, new BinTreeNodeReader(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN),
- new BinTreeNodeWriter(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN, &writerMutex),
- "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-5222", base64_decode(pass), nick);
-
std::vector<unsigned char>* nextChallenge = login->login(*this->challenge);
delete this->challenge;
this->challenge = nextChallenge;
|